For indispensable reporting on the coronavirus crisis, the election, and more, subscribe to the Mother Jones Daily newsletter.

As the Supreme Court heard a major case on gerrymandering on Wednesday, two things became clear: The justices generally seem to agree that gerrymandering is a problem, but they are struggling to figure out what to do about it.

With gerrymandering continuing to distort politics across the country in the run-up to the 2018 midterm elections, the court heard oral arguments in a case out of Maryland. The justices were largely in agreement that the state’s Democratic legislature had purposefully adjusted district lines to make a Republican district turn Democratic. But they weren’t convinced that the solution proposed to the court was workable.

In 2011, Democrats redrew Maryland’s Sixth Congressional District in order to flip it from strongly Republican to reliably Democratic. The lawyer challenging the map on behalf of Republicans in the district argued that the Democrats had unconstitutionally retaliated against Republican voters there based on their political preferences and past voting behavior by diluting their voting power. In doing so, he claims, the state is violating the First Amendment protection against retaliation on the basis of a person’s political views.

The case, Benisek v. Lamone, is the second major challenge to partisan gerrymandering the court is considering this term. It may offer the best chance to persuade Justice Anthony Kennedy, the court’s swing vote on this issue, to address partisan gerrymandering. Kennedy has long hinted that he’s most open to a First Amendment argument against gerrymandering.

Kennedy appeared unhappy with how Maryland Democrats manipulated the district’s lines to give their party a 7-1 advantage in the state’s congressional delegation. During oral arguments, Kennedy and Justice Elena Kagan posited a scenario in which Maryland law explicitly required a 7-1 split. Maryland’s solicitor general, Steven Sullivan, who is defending the map, said that would be illegal, to which Kennedy replied, “So if you hide the evidence of what you’re doing, then you’re going to prevail?”

Chief Justice John Roberts, a conservative, likewise appeared incredulous that the Sixth District was drawn for any reason besides partisan gain. He pointed to the shape of the district, which runs along the state’s borders with West Virginia and Pennsylvania before dipping south to scoop up wealthy and Democratic-leaning Washington, DC, suburbs. “It doesn’t seem to have any internal logic,” Roberts said.

The liberal justices, who are seen as more open to restricting partisan gerrymandering, likewise found the map problematic. Some expressed an urgency to do something about partisan gerrymandering, even if they didn’t find a perfect standard. Justice Stephen Breyer called the map-drawing in Maryland “100 percent partisan” and said the court will never again see a record this clear. (Democratic lawmakers have admitted that the district lines were drawn to help their party.) Map-drawers “are not stupid,” he said. Breyer further cautioned that if the court doesn’t take action on partisan gerrymandering, advanced technology will allow lawmakers to draw even more extreme gerrymanders in the future.

Kagan likewise said the partisan gerrymandering in this case was unambiguous. She noted that hundreds of thousands of voters were moved into and out of the district and that it went from reliably Republican to solidly Democratic. “How much more evidence of partisan intent could you need?” she asked. Even if the court doesn’t come up with a universal standard, it could at least say that this much is “too much.”

But the justices didn’t seem to have any ideas for a clear precedent they could set to prevent extreme partisan gerrymandering in the future. Even the liberal justices had serious concerns about whether the standard submitted in this case—involving the First Amendment—is really the best way to rein it in. Justice Ruth Bader Ginsburg wondered whether the First Amendment theory could even backfire and prevent state legislatures from undoing previous gerrymanders, if they’re not allowed to intentionally shift the district’s partisan balance.

Justice Sonia Sotomayor suggested that the standard be whether partisan gain was the sole consideration in drawing a district. “That gives you a standard,” she said. No one else seemed to jump at that suggestion.

The Supreme Court has long banned legislatures from drawing district lines based on voters’ race. But it has declined to limit their right to draw maps for political gain, allowing lawmakers in both parties to use map-drawing to entrench their power. In its most extreme instances, gerrymandering insulates politicians from the will of their voters. In Pennsylvania, for example, the state’s congressional map reliably gave Republicans 13 of the state’s 18 seats even when Democrats won a majority of votes. (That map was recently found unconstitutional by the state’s supreme court and redrawn.)

The Maryland case is the second major partisan gerrymandering case the court will decide this term. The other case, out of Wisconsin, was argued last fall, and opinions in both are expected to be released together in at the end of the court’s term in June. Though the legal questions presented in them are slightly different, both present the Supreme Court with an opportunity to limit gerrymandering for political gain. Due to advanced technology and improved data on voters, the issue has become more urgent in the last 10 years. Today’s maps were drawn after the 2010 census, which coincided with a Republican wave election that gave the party control of many state legislatures and allowed Republicans to draw some of the most extreme gerrymanders in US history. Opponents of gerrymandering warn that as statistical and mapping technology continues to improve, even more extreme gerrymanders will be implemented after the 2020 census. That makes the court’s decision in these two cases even more critical. As Breyer put it on Wednesday, “if you think what’s happened now is something, wait until you see those computers really working.”