Even before Hillary Clinton officially announced her candidacy, she was thought by many to be a shoe-in for the Democratic Party nomination. But in recent months, Vermont Sen. Bernie Sanders has emerged as a legitimate threat, pushing Clinton onto uneven footing.

On several issues, Clinton has had to shift her rhetoric to more closely mirror Sanders’ liberal stances. Political analysts say Sanders is drawing larger crowds than her at his appearances around the country. And all the while, Clinton has had to fend off a barrage of GOP vitriol.

But can Sanders actually harness this momentum all the way to the White House? And how will Sanders’ brand of socialism fare in Pennsylvania, a middle-of-the-road state that doesn’t skew Democrat or Republican? Can he connect with the working-class rural voters of the state? And can he count on support from socialist contingents in the commonwealth’s urban centers?

“His audiences are eclipsing [Clinton]. [But] she’s got a reservoir of support that Sanders doesn’t have,” says G. Terry Madonna, director of the Center for Politics and Public Affairs at Franklin & Marshall College. “We’re a long way off, but it’s one of the most unpredictable races I’ve ever seen.”

According to poll results from May, Pennsylvanians found Hillary Clinton more favorable then Sanders. But a greater percentage of Pennsylvanians (54 percent) also found her unfavorable compared to just 28 percent for Sanders. At the time, more than 50 percent of the Pennsylvanians surveyed were still unsure about the Vermont senator.

“He’s closed the gap between himself and Clinton in the polls. He actually leads her in New Hampshire. Her favorables are down,” says Madonna. “Sanders is obviously drawing the more liberal Dems. They’re attracted to him for his liberal stances over the years.”

But analysts say Sanders is also appealing to working-class voters for his stances on education and the economy.

“I think Pennsylvania has a working-class backbone and Bernie Sanders touches that in a way other candidates don’t,” says Michael Morrill, executive director of Keystone Progress, a Pennsylvania political-action committee whose mission is to elect progressive candidates. “I think what does resonate with Pennsylvania is he gets to the core of what’s causing anxiety for working-class families, and he has some common solutions. Whether he’s talking about education, taxation or jobs, those are things people are sitting around talking about at kitchen tables and bars.”

And Sanders’ liberal message has forced Clinton to shift her rhetoric to be more progressive. This has been apparent, analysts say, in her recent comments on economics and criminal justice.

“In her conversation with Black Lives Matter a few weeks ago, she was talking about the prison-industrial complex, and she wouldn’t have done that if it weren’t for Bernie,” says Morrill.

But winning Pennsylvania could be about more than appealing to liberals and the working class. Clinton has done well here in the past and has Pennsylvania roots that include family ties to Scranton.

“Pennsylvania is pretty much these days a bellwether in elections. We’re not a truly progressive state, we’re not a conservative state,” says Morrill. “I think they need to come to Pennsylvania. There needs to be some face time.”