A bill advancing in the Virginia House of Delegates would end the familiar "winner take all" system of awarding the state's presidential electoral votes and replace it with a system to award electoral votes by congressional district, similar to what's currently done in Maine and Nebraska.

The goal is a noble one. Under the winner take all system, the votes of people who opted for a candidate other than the statewide winner are quite literally not counted when the electoral college convenes in December. If votes were allocated by congressional district, the final electoral vote tally could more closely represent the statewide popular vote mix.

In 2016, for instance, Hillary Clinton won 49.8 percent of Virginia's popular vote but 100 percent of its 13 electoral votes. Had those votes been allocated by congressional district instead, Clinton would have received only 7 while Trump got 6.

This may seem like a more fair outcome, until you recall that in Virginia, as in most states, partisan lawmakers decide how congressional districts are drawn. In many cases, lawmakers will draw them to give their own party an advantage at the expense of others, a process known as gerrymandering.

For an example of how this skews democracy, consider the case of Pennsylvania. In 2012, 51 percent of voters in the state voted for a Democratic House candidate. But because of the way the congressional districts were drawn, Democrats only won five out of the state's 18 House seats.

The diagram below explains how this could happen at the presidential level. Depending on how district boundaries are drawn, the exact same popular vote could lead to a blowout for one party in terms of electoral votes, a win for the other, or anything in between.

Say we've got 50 people, each represented by a square above. In a hypothetical presidential election, 60 percent of them vote for the blue party candidate, while 40 percent vote for the red.

This 50-person state needs to be divided up into congressional districts. If the district boundaries (thick black lines) were drawn as in Option 1, the electoral votes would closely match the popular vote: blue would get 60 percent of them, or three, while red would get two.

But let's say the blue party is in power and has drawn the districts to favor itself. In Option 2, there are more blue than red votes in each of the five districts. The blue party candidate sweeps all of them, netting all five electoral votes.

But what if the red party were in control? They've creatively drawn the districts in Option 3. In that setup, red party voters have a majority in three districts, while blue party voters only have a majority in two. In that case, blue wins two electoral votes while red gets three.

Again, we're looking at the exact same vote in the options above, but radically different electoral outcomes depending on which party is in power. Under Virginia Republicans' proposal, the final electoral outcome could be susceptible to lawmakers' tampering.

If you believe winner-take-all is a bad, unrepresentative system (which it is), the simplest solution would be to allocate electoral votes by the state's popular vote. If a candidate wins 40 percent of the statewide vote, she gets 40 percent of the electoral vote. Nothing in the Constitution prevents states from allocating electoral votes this way.

An alternative option would be for a state to enter the national popular vote contract, under which a number of states have agreed to award all their electoral votes to whichever candidate wins the national popular vote.

Correction: Virginia House of Delegates, not Representatives

More from Wonkblog: