For the first time in 20 years, Democrats have a chance to draw themselves back into power in both Congress and state legislatures in some key states.

States draw new electoral maps every decade based on new census population data, and the boundaries play a significant role in determining which party controls Congress and state legislatures.

Many states let their politicians draw the maps. Over the past two decades, Republicans have invested a heavy amount of money into controlling state legislatures, and thus the redistricting process, in much of the country. Their investment helped lock their party into power in key states and in Congress for nearly a decade.

But after Donald Trump won the presidency in 2016, the Democratic Party started getting serious about retaking power at the state level. This is the last election cycle before redistricting could lock them out of power in key states for another decade or more — and severely hamper their ability to keep their majority in the House.

“We’re in an election for the next 20 years of our party,” said Jessica Post, president of the Democrats’ state legislative campaign arm, the Democratic Legislative Campaign Committee.

So what state battles matter the most to redistricting? Here’s a rundown.

1. Texas state House

The lay of the land now: Texas, you won’t be surprised to read, has a state legislature and governor’s mansion both controlled by Republicans. But Democrats have been chipping away at the former in the Trump years, picking up a dozen state House seats in 2018. Now they’re nine away from taking the majority in the state House. And there just so happen to be nine seats Republicans hold that also voted for Democrat Beto O’Rourke in the 2018 U.S. Senate race. Republicans are worried enough that they’ve signaled keeping the Texas legislature in Republican control as their top priority.

“Democrats are moving heaven and earth to flip control of state legislatures — the linchpin in their plot to gerrymander themselves into near-permanent power,” said David Abrams, the deputy executive director with the Republican State Legislative Committee, in a statement.

How that could shape redistricting: It would put Democrats in control of one of two chambers in one of the biggest states for the first time in 18 years. They could help draw new electoral maps for the next decade, right as Texas is becoming a bigger player in the battle for the majority of Congress.

2. North Carolina state House and state Senate

The lay of the land now: Republicans control both state legislative chambers, but Democrats ate away at Republicans’ supermajority in 2018 and now have the majority of both chambers in reach in 2020. They are six seats shy of a majority in the state House and five short of holding the majority in the state Senate.

Democrats acknowledge winning these last few will be tough, because some are in Republican territory, and Republicans are putting up a fight to keep both chambers. But North Carolina is also pivotal for the battle for the White House and U.S. Senate, and polls show the Democrats in both those races with slight leads.

How that could shape redistricting: Most states that hand their lawmakers map-drawing power also give governors the chance to veto it. Not North Carolina, which is bad news for Democrats, because Democratic Gov. Roy Cooper seems on his way to reelection.

In the past decade, North Carolina had some fierce court battles over how maps are drawn, going all the way to the U.S. Supreme Court. Those court cases have given Democrats politically friendlier maps to start this next decade. But Democrats still need a seat at the table to draw this next round of maps.

3. Pennsylvania state House

The lay of the land now: Like North Carolina, Pennsylvania is a swing state with divided control: a Democratic governor and Republican legislature. Democrats have a chance to flip both state legislative chambers, but their best shot is in the state House, which they need to net nine seats to do.

Republicans are targeting 17 seats to flip to try to keep their majorities in the legislature.

How that could shape redistricting: If Democrats flip the state House, they would control at least two of the three parties involved in mapmaking, giving them much-needed leverage in the negotiations — and any court fights if they can’t come to an agreement.

Pennsylvania had been known as one of the most extremely gerrymandered states until 2018, when the state Supreme Court declared GOP maps unconstitutional and forced the redrawing of new ones. That played a huge role in helping Democrats win back the majority in Congress the next year.

4. Minnesota state Senate

The lay of the land now: Democrats already control the governor’s mansion and the state House. But they are two wins away from flipping the state Senate. That would give Democrats what’s known as a trifecta, control of both state legislative chambers and the governor’s mansion.

How that could shape redistricting: Then Democrats would have majority control over the mapmaking process — which will be especially handy for the party, given Minnesota could be on the brink of losing a congressional seat due to population changes tracked by the census.

5. Missouri governor’s race

The lay of the land now: Republicans are entirely in control in Missouri, so much so that the state legislature isn’t up for grabs. But there is a competitive governor’s race, with Gov. Mike Parson (R) being challenged by Democratic State Auditor Nicole Galloway. Nonpartisan handicappers say this leans Republican but could go Democratic under the right conditions.

How that could shape redistricting: Having the governor’s mansion will give Democrats veto power over Republican-drawn congressional maps so they don’t get locked out of power for another decade.

But Democrats must also break Republicans’ supermajority in the Missouri state Senate to prevent this chamber from simply overriding a Democratic governor’s veto.

6. Michigan state House

The lay of the land now: Democrats have been gerrymandered out of power here for nearly a decade, but they’re finally at a point where they need to pick up just four seats to win the majority of one chamber. And they already have a Democratic governor.

How that could shape redistricting: Michigan is one of a growing number of states with an independent redistricting commission. Voters overwhelmingly approved a constitutional amendment in 2018 to assign the map-drawing duties to a group of citizens rather than leave it to politicians.

But Michigan Republicans have tried to argue the commission is unconstitutional and want to defund it. So Democrats would feel more secure having even more control of state government to brace for the political fight they know is coming over these maps, no matter who draws them.

Interestingly, just over half of U.S. House seats can’t be gerrymandered after 2020, largely because of a move toward independent redistricting commissions such as the one voters approved in Michigan, and because of courts forcing a number of states to draw fairer maps, writes Louis Jacobson, a state legislative analyst, in the Cook Political Report.

7. Iowa state House

The lay of the land now: Republicans control the state government in Iowa, but Democrats are trying to flip the state House, which they are four seats away from doing. Republicans have also made holding onto this chamber one of their top 2020 priorities.

How that could shape redistricting: Iowa also has an independent commission, but the legislature has influence over approving the maps, and Democrats are concerned that Iowa Republicans, like in Michigan, want to hobble or destroy the independent commission to draw their own maps. So they want to gain as much power as possible to prevent that.

Notable states not on this list: Wisconsin, Ohio, Florida and Georgia

Democrats are so far behind winning the majority in these states’ legislative chambers that they could be locked out of power for yet another decade.

In Wisconsin, they have a Democratic governor, but Republicans are trying to win a veto-proof majority in the state legislature that will give them even more control over the mapmaking process.

Ohio voters recently approved a constitutional amendment to try to reduce gerrymandering, but the Republican-controlled state legislature still controls the process. Democrats are trying to break a supermajority there just to have a bit more of a say.

A really strong Democratic wave in November could help flip state legislative chambers in Florida and Georgia to Democrats, but both are long shots, and it’s more likely than not that Republicans keep their control of the governor’s mansions and state legislatures, meaning they’ll also have control of redistricting to shape the states’ politics for the next decade.