Donald Trump did something that has not happened in almost 30 years: make Pennsylvania go red.

What was once considered an impossible task was made possible by Trump, as he took the Keystone State by a margin of 48.8% to 47.6% over Hillary Clinton and winning by just under 70,000 votes statewide.

But how exactly did he do it?

The simple answer is that Trump was able to increase GOP margins in counties that had gone to Mitt Romney in 2012 while Clinton was not able to do the same in counties that were won by Barack Obama.  We see this especially in the more rural counties and the Pittsburgh Metropolitan Area.  Note: all numbers are taken from the Politico trackers from 2012 and 2016.

In the Pittsburgh Metropolitan Area, the shift was major.  Out of the counties usually defined in the area, only one of them has historically gone to the Democrats: Allegheny County, which houses the City of Pittsburgh inside it.  But the key factor was Trump’s gains in the other counties.  The GOP improved their margins by 6.6 points in Armstrong County, 4.8 points in Washington County, 5.7 points in Beaver County, and a whopping 10.8 points in Fayette County.  Meanwhile, Democratic margin of victory fell in Allegheny County from 56.6% of the vote in 2012 to 56.4 in 2016.  All of this happened with increased voter turnout in almost every county statewide from 2012.

This makes sense seeing as how Pittsburgh is a much more manufacturing-centric area of the state.  Trump’s appeal to low-skilled manufacturing workers made a huge impact in swaying the state his way.

Meanwhile, we can see in the Philadelphia Metropolitan Area that Clinton was not able to get the margins Obama was able to get in 2012.  Clinton lost ground to Trump in Berks County by 3.4 points, Bucks County by 1.6 points, and Delaware County by one point.  The death blow, however, was losing ground in Philadelphia County by 2.8 points.  Gains in Montgomery and Chester were not enough to help Clinton gain ground, even if Chester switched from being won by Romney in 2012 to Clinton in 2016.

Another huge change was in Erie County, which saw a major switch from blue to red.  Erie was a county that Obama won by nearly 17 points in 2012, but turned into a two point Trump victory a mere four years later.  Erie, unlike some of the other counties that saw huge margin changes, had a large population.  More than 115,000 people voted in the county alone this year, and the change in margins in Erie sealed the deal for Trump.

Moving on to the Senate race, incumbent Pat Toomey won re-election over Democratic challenger Katie McGinty by a margin of 48.9%-47.2%.  This was a  hotly contested seat for the balance of power in Congress and a possible opportunity for Democrats to win a seat.  This was evident by the high-caliber people stumping for her, including Elizabeth Warren and Bernie Sanders amongst others.  However, in the end the task was a little too daunting.  McGinty had never served in elected office before, and was a much less polished candidate than the incumbent Toomey.

Lastly, we come to the House.  Unfortunately none of the results were too exciting, as every seat was won fairly easily (only two of the 18 races were within a 10 point margin of victory and none within seven points) and no seats changed hands from one party to the other.