From the White House to the courthouse, every elected official in America—Democrat, Republican, or independent—has something in common: He or she got more votes than the people they ran against.

That adherence to majority rule changes on Jan.20, as it has four other times in our history. While ballots are still being counted, the final tally is likely to find President-elect Donald Trump trailing Hillary Clinton by around 2 million votes; he will be the second of our last three presidents to be elected with less than a majority, indeed less than a plurality, of the popular vote.

That does not make his presidency less legitimate but in a nation that thinks of itself as a beacon for democratic governance, it is nonetheless a jarring statistic. Trump himself has acknowledged that something is askew, telling interviewers he believes future presidents should be chosen by a popular majority.

Trump ran and won under the Electoral College, the product of a deal struck and written into the Constitution more than two centuries ago and effectively refined since then by state laws. It’s time to refine it once again, this time in a way that breaks the dominance of a few “swing” states in our elections and gives every voter in every state an equal voice.

We can do that through the National Popular Vote Compact, an agreement that Common Cause and other democracy reform organizations have helped push through legislatures in 10 states and the District of Columbia but that still has considerable ground to cover before it can be implemented.

A bit of history is in order here. Wary of popular democracy, a radical idea in the 18th century, the nation’s founders fiercely debated the process for selecting the president, ultimately entrusting the job to “electors” selected by the states. Each state was awarded one electoral vote for each of its two U.S. Senate seats and an additional vote for each of its congressional districts. States could then decide how to award those electors. As part of the compromise, southern states included slaves in their population, giving them more congressional districts even as they denied slaves the right to vote. Northern and southern states alike also barred women and, in most cases, non-landowners from the ballot box.

Today of course, almost every adult citizen over age 18 has the right to vote, protected by law. But the Electoral College endures although the way electors are chosen has changed many times over our history, so that all 48 states now award their electors on a winner-take-all basis while Maine and Nebraska award theirs based on the returns in each congressional district plus two for winning the state overall.

Those winner-take-all rules are state laws, not in the Constitution, and they effectively direct candidates away from “safe” states that are either deep red or true blue; Hillary Clinton paid little attention to California and Donald Trump mostly ignored Texas because those states and their hefty electoral votes were safe for their respective parties. Trump and Clinton spent 94 percent of their campaign money and post-convention visits in this election in only 12 states; 25 states essentially had no role in picking the president.

The National Popular Vote Compact would bring every state and every voter into play. National candidates would be incentivized to campaign all over the nation, not just in today’s “battleground” states.

The compact would take effect once states with 270 electors (an Electoral College majority) pass identical legislation adopting it. Once it’s in effect, presidential electors in participating states would be required to vote for the candidate who wins the national popular vote, regardless of who carried their state’s popular vote.

This is a constitutional and practical way to implement nationwide popular election of the president. Washington, D.C., and the 10 states already on board have 165 electors, so states with an additional 105 electoral votes must approve the compact before it goes into effect. Polls suggest 70 percent or more of Americans believe the president should be the candidate who wins the most popular votes.

Part of the genius of our Constitution is its built-in flexibility. The National Popular Vote Compact is in keeping with the spirit of our nation’s charter; it will refine the Electoral College for the 21st century, carrying us further toward the “more perfect union” the Constitution was drafted to provide.