It has become painfully clear in recent years that partisan gerrymandering is one of American democracy’s worst illnesses. Although the Supreme Court held decades ago that the purpose of redistricting was to ensure “fair and effective representation for all citizens,” legislators often use the process to lock the minority party out of power. Both Democrats and Republicans deploy partisan gerrymandering to dilute votes for their opponents, creating one-party rule and, arguably, greater polarization. That’s bad for the body politic and a clear contravention of the Constitution. But as long as the courts refuse to step in, gerrymandering will continue to plague the country.

Now Paul Smith, one of the greatest legal minds in the country, is asking the Supreme Court to finally put a stop to it. And here’s the exciting part: He might actually succeed.

Smith, a renowned Supreme Court litigator, recently joined the Campaign Legal Center’s battle against Wisconsin’s egregious partisan gerrymander. The CLC believes it has finally developed a winning strategy to combat partisan redistricting, developing a mathematical formula to help courts decide which gerrymanders violate the Constitution. It triumphed in district court, where a three-judge panel agreed that Wisconsin’s redistricting scheme was unconstitutional, citing the CLC’s formula in striking down the map. A peculiarity in federal law ensures that Wisconsin can appeal the decision directly to the Supreme Court, which must hear the case. Smith and the CLC are now preparing for the greatest showdown over political redistricting in a generation.

The difficulty in curbing partisan gerrymandering has not been in convincing judges that the practice is unconstitutional—the Supreme Court has found that it is—it’s convincing judges that they can fix it. Most gerrymanders involve a blatantly unconstitutional practice called “packing and cracking”: packing some supporters of the opposing party into a few “safe” districts and distributing others throughout a bunch of districts to dilute their votes. This form of gerrymandering runs afoul of two constitutional guarantees: The First Amendment, which prohibits discrimination on the basis of a person’s viewpoint, and the Equal Protection Clause, which bars the government from disfavoring individuals on the basis of an illegitimate classification like political affiliation.

In 2004’s Vieth v. Jubelirer, which Smith argued, five justices agreed that partisan gerrymandering likely violated the Constitution. But one of these justices, Anthony Kennedy, wasn’t sure quite how to fix the problem, and so he voted with the conservative justices to toss out a challenge to a Pennsylvania gerrymander—without closing the door to future lawsuits. In a concurring opinion, Kennedy wrote that partisan gerrymandering seems to unconstitutionally “burden representational rights” by “penalizing citizens” because of their “association with a political party” or their “expression of political views.” Still, Kennedy insisted, courts should not intervene until they could articulate “principles of fairness in districting”—specifically, a formula to decide when the burden placed on representational rights crosses the line into unconstitutionality. Otherwise, he argued, “the results from one gerrymandering case to the next would likely be disparate and inconsistent.”

Smith and the CLC believe they have found the right standard in the work of two scholars, Nicholas O. Stephanopoulos and Eric M. McGhee. This formula—called the “efficiency gap”—cites two types of “wasted votes” in the redistricting process: “lost votes” cast in favor of a defeated candidate, and “surplus votes” cast in favor of a winning candidate that weren’t actually necessary for the candidate’s victory. The efficiency gap is, in Stephanopoulos’ words, “the difference between the parties’ respective wasted votes in an election, divided by the total number of votes cast.”

When both Democrats and Republicans waste roughly the same number of votes, the efficiency gap is near zero. That means voters on both sides had a fair shot at securing their desired representation. When a party gerrymanders its opponents into the minority, however, it will “waste” fewer votes than its opponents, causing the efficiency gap to rise. A historical analysis of elections across from the country since 1972 suggests that an efficiency gap of 7 percent will entrench the majority party’s power until new maps are drawn. Wisconsin’s Republican-drawn gerrymander has an efficiency gap of 13 percent, meaning a huge number of Wisconsinites are currently deprived of their representational rights solely because they are Democrats.

This formula may sound like an oddly technical method for ensuring basic representational equality. But the justices have waded into algebraic waters before. The court has long held that the Constitution enshrines the principle of “one person, one vote,” meaning districts should contain about the same number of people so that no vote counts more or less than others. But over several decades, it has had to decide what amount of deviation from the “one person, one vote” principle was constitutionally permissible. Ultimately, the court found that the deviation between the population of the largest and smallest districts in a state cannot exceed 10 percent.

Smith stresses that the court need not settle on such a specific standard this time around to find Wisconsin’s gerrymander unconstitutional. The justices could instead accept the efficiency gap as a satisfactory way to measure the burden placed on representational rights and hold that, wherever the constitutional line is ultimately drawn, Wisconsin has surely crossed it.

“We’re not asking anybody to set a 7 percent threshold,” Smith told me. “It makes more sense for the threshold to emerge over time.” For now, the Supreme Court need only find that the partisanship of Wisconsin’s gerrymander—thoroughly documented by the district court—“went so far beyond the norm” that it violated citizens’ constitutional rights.

A decision invalidating Wisconsin’s gerrymander as unconstitutionally partisan would, of course, be a boon to democracy. But it would also be a godsend to Democrats, who are in the process of being gerrymandered into oblivion. When the GOP swept statehouses in 2010, its strategists created REDMAP, a lavishly funded project that used high-tech analyses to draw maps with the specific purpose of disfavoring Democrats. (Districts are redrawn every decade using new census data, typically by state legislatures; and the next redistricting will occur in 2021.) REDMAP’s extraordinary success (for the GOP) can be measured in elections: In 2012, Democratic House candidates won 1.7 million more votes than Republicans, but Republicans wound up with a 33-seat advantage—a clear result of gerrymandering. The imbalance was particularly apparent in Arizona, Michigan, North Carolina, Pennsylvania, and Wisconsin, where Democrats won more than half the votes but less than half the congressional seats. A huge part of Democrats’ down-ballot collapse during the Obama era, especially in state legislatures, can be attributed to gerrymandering.

Democrats gerrymander too when they can—though not as well as Republicans—a fact that can make the issue seem like politics as usual. It’s not: In its modern iteration, with every line carefully calculated to disfavor one party, it’s a threat to the health of our democracy. Political scientists often debate whether gerrymandering creates greater polarization by pushing politicians toward ideological extremes to appeal to their parties’ fringes. But the problem is really more fundamental than that. Partisan gerrymandering imposes a significant disadvantage on certain citizens because of their political affiliation and expression. That is simply unacceptable under our Constitution. As Smith and the CLC demonstrate, partisan gerrymandering is a problem the courts can fix. And it’s time for the justices to get the ball rolling.