For months, Supreme Court obsessives (guilty as charged) have been waiting for the court to decide whether to permit the Trump administration to add a question about citizenship to the 2020 census. That decision could come down as soon as Thursday, but it might not be long before the topic is back in front of the high court. If the justices rule that the question can go on the form, the legal fallout from the ruling could get messy quickly.

[Related: The Citizenship Question Could Cost California And Texas A Seat In Congress]

Much of the controversy around the question has focused on how it will affect the accuracy of the population count. There’s a reason for that — as I wrote earlier this week, census data helps guide countless decisions about American life, including how our congressional representatives are distributed. But there’s an additional fight brewing, and it has major implications for FiveThirtyEight’s other favorite topic: gerrymandering.

For years, some conservative advocates have been interested in using a census citizenship question to change how legislators draw their states’ electoral maps. The Constitution requires that the number of representatives each state gets be determined by its total population, but it’s not clear what the rules are for how states should draw the districts that elect those representatives, leaving the door open for states to argue for alternative ways of counting the population within districts. Specifically, conservatives have focused on drawing district boundaries based on the number of citizens, rather than the number of people. You can imagine the lawsuits that would come next.

The raw political stakes of the court’s decision were unexpectedly revealed last month, when a prominent Republican redistricting expert’s research was made public. In 2015, he had concluded in a study commissioned by a conservative news outlet that the citizenship question would provide lawmakers in Texas with the data they needed to draw maps that would be “advantageous to Republicans and non-Hispanic Whites.”

Our analysis of data from Andrew Beveridge, a sociologist and CEO of a data visualization firm called Social Explorer, confirms that removing noncitizens from the population count would likely help Republicans when redistricting season rolls around, by making it easier to shift the balance of political power from urban to rural areas. Using census data, Beveridge estimated how big each state’s congressional districts would need to be if only citizens of voting age were counted, then calculated how much each current district would need to grow or shrink to meet that threshold.

And it’s not just a matter of reshuffling a few people — several urban districts that are currently controlled by Democrats would have to gain well over a hundred thousand voters to meet the new population threshold in their state.

It might seem like growing in size would give a Democratic-leaning district more clout, but the opposite is much likelier to be true. Republican lawmakers could stuff more of their state’s Democratic-leaning voters into a smaller number of districts, giving the legislators more room to create districts where Democrats don’t have a majority. (This is the infamous “packing and cracking” that comes up all the time in gerrymandering articles.) According to one estimate by researchers at the Urban Institute, Republicans could stand to gain as many as two additional congressional seats if Texas was redistricted based on the number of citizens rather than the total population. And multiple redistricting experts told me that political power could be shifted away from diverse, growing cities like Houston and Dallas and toward rural areas of the state where fewer noncitizens (and fewer people in general) live.

While many congressional districts in Texas and Arizona would need double-digit population shifts to meet the new standard, the political benefits are less obvious in Missouri and Nebraska, at least in terms of congressional maps. But counting only citizens could lead to significant changes to state legislative districts, which are smaller than congressional districts and therefore likelier to be affected by changes in who’s counted for redistricting purposes. In 2016, when the Supreme Court heard a case about whether states should be required to draw their legislative districts using citizen-only populations, Beveridge estimated that if the country switched to the narrower population measure, every state would have to redraw at least some districts and found that the number of Republican-dominated maps would likely increase.

In that case, the justices ruled that states couldn’t be forced to draw maps using only citizens, which means the scenario predicted by Beveridge ultimately didn’t come to pass. But the justices didn’t weigh in on whether states could voluntarily adopt a different population measure — leaving the door open to future attempts.

If Texas or any other state tries to use data from the citizenship question for redistricting, the question will almost certainly end up back at the Supreme Court. If that happens, the justices will have to decide whether people who can’t vote still need to be counted for the purposes of political representation. Both sides say it’s a question of fairness. Conservatives argue that the votes of each person in a district with large numbers of noncitizens counts more than the vote of someone in a citizen-heavy district where there are more other voters to compete with, which skews political power toward the parts of the country with more immigrants. But advocates for including everyone point out that because noncitizens still pay taxes and use public services, they have just as much of a stake in politicians’ decisions as voters do.

Justin Levitt, a professor at Loyola Law School, Los Angeles, said that in addition to any constitutional challenges, it’s also possible that redistricting using citizen-only data could be illegal under the Voting Rights Act if the state has a history of discrimination against racial minorities. But he added that the process of finding out could take a very long time. “It’s 2019, and we’re still litigating partisan gerrymandering cases from 2011,” he said. “And the legislators get to stay in power while all of this is being fought out.”

If the citizenship question does ultimately enable some states to use a different standard for who gets political representation — and the Supreme Court upholds it — the effect could be even broader than Republicans picking up more seats in Congress or state legislatures. Michael Li, senior counsel at the Brennan Center for Justice who works on voting rights cases, said that there are still some Republicans representing urban or suburban areas in states like Texas, particularly in the state legislature, whose seats might be jeopardized. “If you have more rural districts, that could mean it becomes even harder for moderate Republicans to get elected,” he said.

Meanwhile, noncitizens would still continue to pay taxes and use government-run institutions like schools, but the political center of gravity would shift away from the places where they live. “People in rural Texas are not going to have the same priorities as the people living in Houston or Dallas,” Li said. “It will be harder for urban areas to get their needs met.”

Supreme Court justices hand down opinions