The Democrats are flying high right now, but they’re headed for a crash. Fifteen or 20 or, good God, maybe even 30 of them are lining up to run for president two years hence, and the party—and the American electoral process more generally—has no good way to select a nominee when so many aspirants split the vote.

In a field of 10 or 12 candidates, it doesn’t take much to come out on top. The winner of the first contests, before the field has been winnowed, will be anointed as the frontrunner, with all the electoral advantages that conveys, even though in a field that crowded, he or she may have won only 15 percent of the vote. Say, for instance, former New York Mayor Michael Bloomberg, who can easily spend billions on his campaign, takes the early contests with that 15 percent, while Bernie Sanders, Elizabeth Warren, Joe Biden, Kamala Harris, and Sherrod Brown lag narrowly behind. Bloomberg (or whoever) could build a commanding lead even though it’s likely a majority of Democrats might not want him as their nominee

That may seem fanciful, but that’s how Donald Trump built an early and decisive lead in the 2016 Republican primaries. Facing off against half a dozen serious opponents, Trump never came close to winning a majority until almost all of them had been compelled to drop out. His more conventional adversaries so divided the vote that he captured the nomination.

What’s a more rational way to winnow the field? I suppose the Democrats could adopt NCAA-like brackets, with the winner of the billionaires’ primary (which might feature Bloomberg, Tom Steyer and Starbucks’s Howard Schultz) facing off against the winner of the left primary (Sanders, Warren, and maybe Brown), with the winner of that going up against the victor of the center-left senator bracket (Kirsten Gillibrand, Amy Klobuchar, and Cory Booker), who … well, this system has problems, too.

The one way to ensure that the nominee actually is favored by a majority of Democratic voters is for the party to adopt a form of ranked-choice voting. Under this system, voters would be able to designate one candidate as their first choice, another as their second, and another as their third. Maine recently adopted such a system. The political parties would have to devise the system they want to use, but they would need the cooperation of the states, which would have to rework their computer systems to accommodate rankings.

If there really are 20 candidates on the early state ballots, I can’t see asking voters to rank them all, much less the computers to tally all those rankings. But in a field as densely populated as the Democrats’ is shaping up to be, voters should be given the opportunity to cast their votes for win, place and show (and maybe fourth and fifth as well)—though if they just want to vote for one or two candidates, that should be their prerogative, too.

Each vote for a candidate would be assigned points depending on the ranking—let’s say three points for each vote that chooses the candidate above all others, two points for second-place ranking and one for third place. The strength of this system is that it measures the breadth, not just the intensity, of a candidate’s support.

So if the Bloomberg backers give him 15 percent of the first-place votes but no one ranks him second or third, he would finish behind, say, a Sanders or Warren or Harris, who each might get 10 percent of the first-place votes but 15 percent of the second- and third-place votes. There are plenty of other ways to structure the scoring, but any of them would be more reflective of voter sentiment than the current one, which in a large field can elevate a candidate with a narrow base of support.

Such a system has its own problems. Computers would have to be reprogrammed and that would entail some expense. Second, it’s not likely that the final vote totals would be known for some time, which would frustrate both the media and the electorate. Third, in an ideal world, both the Democratic Party and the states would agree to shift to this system. In our world, however, it’s not clear why Republican states would want to oblige the Democrats, nor is it clear that the Democrats themselves would want to make this change, though it would likely produce the strongest possible nominee. Party-vs.-state court battles might well ensue.

Still, as this is in the Democrats’ interest, it’s the biggest blue states—New York, Illinois, and above all, California—that have the clout to make this shift. For all its complexities, it beats the kind of process that enabled Trump to become the Republicans’ nominee.