American democracy is in deep trouble. Polarization is worsening, and respect for U.S. leadership around the world is in free fall. The good news is that a federal judge’s upcoming ruling could pave the way for a major reform in the way we elect our presidents—and help get us back on track.

Last year, Americans chose a president who, like his opponent, was disliked by a majority of voters. The nation is alienated and angry about the way we choose our leaders. Seven out of eight Americans agree that “the political system is broken and doesn’t serve the interests of ordinary people.” Disaffection in the United States spells serious danger for our ability both to enact serious policy at home and to lead abroad.

The remedy? Four decades of studying democratic development and failure around the world have convinced me that the rules of the game matter a lot. And our rules restrict political competition to a Democrat and a Republican. As these parties have moved to their extreme wings, more moderate voters are stranded with nowhere to go.

The quickest and easiest rule change would open up the final fall presidential debates. Yes, the debates are key. No one can be elected president in November without participating in them, but for more than a quarter-century, the rules have effectively permitted only a Republican and a Democrat on the stage.

As a result, Americans are stuck with a choice between the nominees of two political parties with origins far back in the 19th century. Just last month, Gallup found that 46 percent of Americans say they are independents, compared with 27 percent who identify as Democrats and 25 percent as Republicans. A separate Pew poll found that the younger the voter, the more inclined he or she is to be an independent. Clearly, our current rules do not serve a sizable portion of the electorate.

In other countries, debate participation goes beyond the established parties, with powerful results. In France, for example, President Emmanuel Macron, a centrist from an upstart new party, probably owes his election last year to his performance in a five-way debate.

But the current U.S. rule excludes anyone who has not polled an average of 15 percent in a series of surveys taken less than two months before the November election. Since 1960, no one who did not participate in a major-party primary has ever met that criterion. Ross Perot was polling in the single digits when he was permitted into the debates under the old rule. His stunning 1992 showing—winning 19 percent of the vote—demonstrates that participation in the debates is critical to building support needed to mount a credible independent candidacy.

The gatekeeper for determining who enters the presidential debates should be a strictly non-partisan and independent body. Instead, the Commission on Presidential Debates (CPD) has been dominated by people with deep roots in the two dominant parties, including national party chairmen. Many CPD members publicly support Republican and Democratic candidates for president, donate to them, and hold fundraisers for them. What these partisans agree on is preserving the duopoly.

The Federal Election Commission (FEC) has the power to end this corrupt state of affairs and force the CPD to open the debates to a third candidate, but the FEC, which like the CPD is known for its fealty to the two parties, refuses.

In 2014, a nonprofit group called Level the Playing Field, headed by Peter Ackerman, a scholar and business executive who has been chairman of Freedom House and the Fletcher School of Law and Diplomacy at Tufts, filed a lawsuit in federal court against the FEC for flagrantly ignoring its duty. The plaintiffs won the first round last February, when U.S. District Court Judge Tanya Chutkan, in a blistering opinion, ruled that the FEC had acted in a manner that was “arbitrary, capricious, and contrary to law.”

The Judge blasted the FEC for “its refusal to engage in thoughtful, reasoned decision-making in either enforcement or rulemaking in this case” and ordered the commission to “reconsider the evidence and issue a new decision consistent with this Opinion within 30 days.”

The FEC’s review, however, went nowhere. Rather, the FEC called the CPD’s debate-access rules “objective” and said the debate commission was not a partisan organization, so there was no need to act. This stonewalling led to another round of litigation, with the final challenging brief concluding, “Enough is enough. The time has come to hold the FEC accountable for its derelict oversight.”

Two-thirds of Americans say they want the option to vote for an independent candidate for president, but today a meaningful vote is impossible because of the rules set by two gatekeeper commissions that are essentially wholly owned subsidiaries of the two established parties. This cynical drama demonstrates that bi partisanship can in fact be the worst form of partisanship when its goal is to preclude wider competition.

The district court is expected to issue its ruling soon. That decision could go a long way toward reviving democracy in America at a critical time in our nation’s history.