Last Monday afternoon, the Pennsylvania Supreme Court ruled that Pennsylvania’s congressional district map, which was approved in 2011, violates Pennsylvania’s state constitution. In this case, a group of Pennsylvanians, including the League of Women Voters of Pennsylvania, has sued the Commonwealth of Pennsylvania claiming that the map was created by Republicans to stifle the voice of Pennsylvania Democrats in an attempt that “strikes at the foundation of representative democracy.”

The petitioners argued that the congressional map employs the gerrymandering methods of “packing” and “cracking,” meaning that the map was seemingly drawn to pack Democratic voters into just a few districts while cracking the rest of the Democratic electorate into pieces throughout the remaining districts. Critics claim that this map deprives Democratic voters of their voting power. In the last seven years since the passage of this map, Republicans have consistently held 13 of the 18 congressional districts of Pennsylvania even when Democratic candidates won a majority of votes statewide.

As part of the testimony, petitioners called Carnegie Mellon professor Wesley Pegden to testify that the map had a partisan bias. Pegden has created an algorithm that can test whether a districting map has been created with partisan intent. In order to test a map, the algorithm takes the map in question and makes random small changes to it. Then the algorithm checks whether these changes affected the map’s partisan bias. One can then determine using probabilities whether a map has been rigged along party lines. Pegden showed that when the Pennsylvania congressional district map was plugged into the algorithm, making small changes almost always made the map more competitive. The court used Pegden’s algorithm as evidence that the map had been created to be purposefully uncompetitive.

Although the map has received significant opposition, Republicans still stand by it. Steve Miskin, a spokesman for Republicans in the Pennsylvania State House of Representatives said in a Pittsburgh Post-Gazette interview, “Some cynics might question the timing, after three elections of not saying a word about these maps.” In response to this doubt, David Gersch, a lawyer for the petitioners explained that the suit was not filed until now so that there would be enough real evidence of the effects of the map on elections. Drew Crompton, the general counsel to Republicans in the Pennsylvania State Senate, also defended the map, calling the suit “baseless” in the Pittsburgh Post-Gazette and pointing out that 36 Pennsylvania House Democrats had voted for the map.

On Jan. 23, the day after the Pennsylvania court’s decision, a group of Republicans from the Pennsylvania State House and Senate applied for the court to grant a stay on their order, meaning that the ruling wouldn’t go into effect until after the 2018 congressional elections. The court denied this application two days later.

Historically, courts have hesitated to rule in political cases, claiming that politics exists in the legislative domain. Baker v. Carr in 1962 was the first Supreme Court case to step into the “political thicket” and rule against a redistricting practice. In general, courts have found racial gerrymandering to be unconstitutional but not partisan gerrymandering, largely because it has been difficult to measure partisan affiliation because, unlike race, a voter could potentially change political parties from one election to another out of no fault of a district map. Consequently, in U.S. Supreme Court cases in 1986, 2004, and 2006, justices called partisan gerrymandering “illegitimate, seriously harmful, incompatible with democratic principles and ‘manipulation of the electorate,’” but did not rule against the practice because it was difficult to draw the line between political and unconstitutional.

This Pennsylvania case is one of a number of cases of alleged Republican gerrymandering of state congressional district maps. The Republican strategy in 2010 was to take control of state legislatures so that the party could control the redistricting efforts across the country after the 2010 census. With the 2018 congressional elections looming, many of these maps are being taken to court. Most notable is Gill v. Whitford in Wisconsin, which has made it all the way to the U.S. Supreme court. One dissenting justice in the Pennsylvania case argued in his dissent that Pennsylvania should hold off on changing its congressional map until after a ruling is decided in the national case. However the Supreme Court rules in Gill v. Whitford, the Pennsylvania ruling means that the state will get a new district map. Experts say that if the court rules against gerrymandering in this national case, up to 20 states will be required to join Pennsylvania in throwing out their congressional maps too.