The battle for control of the Senate remains a tossup heading into the final week of the election, with both parties scrambling to add money in critical battleground states and polls showing many of those races well within the margin of error.

Democrats still believe they are on track to win a slim majority, but Republicans intend to go on offense after Friday’s news that the FBI is investigating new emails potentially relevant to its probe of Hillary Clinton’s email practices. Democrats, meanwhile, are continuing to tie down-ballot Republicans to Donald Trump, hoping that a potential loss by the nominee in key battlegrounds will drag other Republicans down with him.

Republicans are confident they will hold on to seats in Florida and Ohio, though a Democratic outside group transferred more than $1 million to Florida last week to try to keep that race competitive. Meanwhile, Democrats believe they will win races against GOP incumbents in Illinois and Wisconsin, although Republicans argue the latter contest has narrowed recently; indeed, the same Democratic outside group added $2 million to bolster former Sen. Russ Feingold, who’s running against Sen. Ron Johnson.

That leaves six races that will likely determine the Senate majority: Indiana, Missouri, North Carolina, Nevada, Pennsylvania and New Hampshire.

Democrats currently lead in just two of those races, according to RealClearPolitics polling averages, and if election results fall along the same lines as the averages, Republicans would hold a slim one-seat majority. If Democrats can flip just one other seat, based on current polling averages, it would be enough to give them a majority if Clinton wins the White House and Sen. Tim Kaine becomes the tie-breaking vote as vice president.

Both parties are scrambling to make their closing arguments, beef up their advertising and get out the vote in the final days of the raucous campaign. Senate Majority PAC, a leading Democratic super PAC with ties to Minority Leader Harry Reid, raised $19 million in the first three weeks of October, while the Senate Leadership Fund, a super PAC with ties to Majority Leader Mitch McConnell, has raised more than $30 million this month. Though the overall Senate picture remains a close battle, some nonpartisan analysts give Democrats a slight edge.

“I am fairly confident that [Democrats] will get to at least 51 seats,” said Jennifer Duffy, a senior editor at the nonpartisan Cook Political Report.

Here’s a look at the states that will determine the majority:

Pennsylvania

Democrats hoped they’d be able to lock up the Keystone State, where Clinton leads by 5.8 percentage points in the RCP average and Trump hasn’t led in a public poll since July, but freshman Sen. Pat Toomey has shown an ability to outpace Trump by a significant margin.

Toomey has declined to say whether he supports Trump, something Democrats have hammered in their messaging throughout the campaign. The incumbent is relying on his conservative credentials to carry him in heavily Republican parts of the state, while hoping that his more moderate stances, such as his work on a gun-sale background check bill in 2013, could sway some moderate and independent voters in the area around Philadelphia.

Democrats are trying to rally their faithful in Philadelphia and the collar counties, hoping that high turnout will lift Clinton to a significant victory and carry Katie McGinty over the top. Popular Democrats including Sens. Bernie Sanders and Elizabeth Warren, President Obama and Vice President Biden, have campaigned in Pennsylvania to help lift McGinty, who currently leads by two percentage points in the RCP average.

New Hampshire

New Hampshire may be the closest race heading into the final stretch. Both candidates -- freshman Republican Sen. Kelly Ayotte and two-term Democratic Gov. Maggie Hassan -- are extremely well-known and popular in the state. They will participate in their sixth and final debate Wednesday, and New Hampshire’s 1.3 million residents likely know nearly everything about their candidates.

Ayotte has had perhaps the most tortured road, thanks to Trump. She first said she would support but not endorse him, then called him a role model before walking that back and ultimately withdrawing her support. That disavowal enabled Ayotte to focus exclusively on local issues in recent weeks, but Democrats have continued to attack her on the standard-bearer, and still believe Ayotte will pay a price both with moderates turned off by her early support of Trump and conservatives frustrated by her withdrawal of it.

Ayotte’s campaign hasn’t just been playing defense, however. The candidate attacked Hassan for her support of Clinton amid concerns over the former secretary of state’s email situation, and claimed the governor has run a cookie-cutter campaign, simply adhering to her talking points. More than in any other race, Ayotte and New Hampshire Republicans have argued that the opponent would be a rubber stamp for Clinton’s agenda should the Democrat win the White House. Both parties have largely ignored volatile polls in the race, and believe it will stay within the margin of error until Election Day. Ayotte currently leads by 2.7 percentage points in the RCP average.

Nevada

Nevada represents the only chance Republicans have to pick up a seat currently held by a Democrat, which would give their slim majority a significant buffer. That, plus the personal pleasure most Republicans would take in flipping Harry Reid’s seat, have made this their top target. Polling for much of the summer and fall showed Rep. Joe Heck, the Republican candidate, with a relatively safe lead over former Democratic Attorney General Catherine Cortez Masto.

Much of this race has become a proxy fight, with Democrats tying Heck to Trump and Republicans tying Cortez Masto to the Senate leader, who has built up the Democratic Party in the state and essentially hand-picked Cortez Masto to succeed him in Washington.

But Democrats believe they’ve seized momentum in the race after Heck became one of more than a dozen Republicans to withdraw their endorsements of Trump in the wake of audio in which Trump made lewd comments and boasted of making unwanted sexual advances. Some Republicans in the state expressed frustration with Heck over the decision, and Democrats hope that if there is high Democratic turnout and Clinton wins even a narrow victory -- she currently holds a slight edge in the polling average -- Cortez Masto will be able edge out Heck.

They are also counting on a depressed Republican turnout, and hoping that some conservatives who back Trump would decide against supporting Heck over his disavowal of the GOP nominee (he has declined to say whom he will vote for, according to Talking Points Memo, other than to say it won’t be Clinton). Yet Heck still has a slight edge in the state, leading by 0.4 percentage points, according to the RCP average.

Missouri

The Show Me State represents perhaps the biggest surprise of the cycle, although Democrats have been confident about this race since Secretary of State Jason Kander, a 35-year-old Afghanistan War veteran, announced his candidacy in early 2015. They have relentlessly attacked freshman Sen. Roy Blunt as a D.C. insider, criticizing the fact that his wife and son are political lobbyists, and saying that Blunt has abandoned Missouri. The incumbent’s campaign has pushed back on these attacks, but some Republicans think they have impacted the race because Blunt didn’t prepare early enough for a competitive race.

The top of the ticket isn’t having a major effect on this contest, with Trump on pace to win Missouri and Clinton not competing there. But Kander believes he’ll be able to woo some Trump voters with his outsider message, which could allow him to run ahead of the presidential ticket.

“Those same voters are not then going to the next line on the ballot and voting for somebody who’s been in Washington for 20 years and has made Washington work for them and not for Missourians,” Kander told RCP last week.

Blunt, meanwhile, has been working hard to bring the GOP faithful home, and would be able to stave off an upset if most Republicans vote for him. He campaigned last week on potentially being the “51st Republican senator” and talked about the implications of that in terms of Clinton’s agenda and the Supreme Court.

“I don’t think there are going to be very many Donald Trump-Jason Kander voters,” Blunt said in an interview. He currently has a one-point lead in the RCP average.

North Carolina

The Tar Heel State is, like Missouri, one Republicans didn’t expect to be hyper-competitive. But several factors, including Clinton’s consistent lead in the state, the competitive governor’s race and backlash over the controversial law requiring people to use restrooms based on the gender on their birth certificate, have made North Carolina competitive.

Some Republicans in Washington expressed frustration with Sen. Richard Burr, a two-term incumbent who chairs the intelligence committee, for not getting his campaign off the ground quick enough in a difficult environment. But Burr has campaigned aggressively in the final weeks of the election, hitting his opponent, Deborah Ross, for her work lobbying for the ACLU in the 1990s. (His campaign has released multiple attack ads citing a memo in which she raised concerns about legislation creating a public database for sex offenders.) Ross’ campaign has pushed back, arguing the Republican attacks misrepresent her position at the time.

Ross is not well known statewide, having only served in the state legislature, but she has campaigned aggressively to increase her name ID. Clinton has given her shout-outs during rallies in North Carolina, hoping to lift her campaign. Burr, meanwhile, hasn’t shied from supporting Trump, and appeared at a conservative rally Friday headlined by the nominee’s running mate, Indiana Gov. Mike Pence.

Burr has outpaced Trump in many recent polls but currently has just a one-point edge over Ross in the RCP average.

Indiana

Democrats got a boost in their chances to take back the Senate when Indiana’s Evan Bayh, who served two terms as both senator and governor, decided to enter the race over the summer. Since then, Republicans have hammered him over how much time he spends in Indiana versus Washington, his work for a major Washington law firm and various organizations after his Senate career, and meetings with some of those organizations during his final year in the Senate.

Republicans believe they’ve made a major dent in Bayh’s popularity in the Hoosier State, which could help lift Rep. Todd Young, who’s challenging him. But Bayh maintains a 3.7 percentage point lead in the RCP average, and Young has yet to lead in a public poll of the state. Donald Trump is on track to win Indiana on the presidential level, but Bayh is counting on support from some crossover voters.