The debate about why, exactly, Hillary Clinton lost the 2016 election is sure to continue for some time.

But a new survey may shed some more light on exactly when she fell behind Trump: at the very end of the campaign.

The new data comes from the University of Pennsylvania’s Institute for the Study of Citizens and Politics, which surveyed the same panel of people two weeks before the election and again about three weeks after the election.

The researchers found that during that period, Trump’s support among panel respondents increased by 2.3 percentage points, while Clinton’s declined by 1.7 percentage points.

Dan Hopkins, who oversaw the survey, writes at FiveThirtyEight that this suggests Trump didn’t just outperform the polls because the polls were wrong, but rather that there was late movement toward him from undecided voters and even some Clinton supporters.

In other words, more voters seem to have decided to support Trump in the final weeks of the election than support Clinton — a shift that very well could have cost her the race, since she lost three key swing states by less than 1 percentage point each.

Voters swung against Clinton in the final weeks

Two weeks before the 2016 election, 15 percent of the electorate had not decided who they were voting for — three times as many undecided voters than in the 2012 election, according to FiveThirtyEight’s Nate Silver.

And among the ISCAP panel of voters, people who two weeks before the election were undecided or backing third-party candidates were more likely to break for Trump than Clinton in the end.

“Trump also outpaced Clinton among people who were previously undecided or third-party backers, with 3.1 percent of respondents moving from those categories to Trump while just 2.3 percent did the same for Clinton,” Hopkins writes.

Furthermore, Clinton lost more of her own mid-October supporters in the panel than Trump did — with some defecting to third-party candidates or not voting, and some (0.9 percent of the panel) moving over to Trump.

There are many factors that could have contributed to this change so late in the game: Negative media coverage of Clinton soared in the final days and the FBI announced they had discovered new emails related to Clinton’s private server, only to find them inconclusive a week later. Or perhaps Trump’s status as the “change” candidate made undecided voters likely to tip toward him at the end all along.

Now, Hopkins acknowledged one potential pitfall in the ISCAP survey — since it was conducted after the election, respondents may be more likely to claim they backed the winner. But he argues that the panel’s 2012 results suggest “respondents aren’t likely to change their responses so soon after Election Day.”

Clinton’s campaign argues that the Comey letter swung the election

When asked to explain their loss, the Clinton campaign has been known to cite the letter from FBI Director James Comey, which announced 10 days before Election Day that the FBI had discovered new emails that appeared to be “pertinent” to its Clinton’s private email server investigation. (A week later, Comey sent another letter saying the new emails didn’t change his conclusion that Clinton couldn’t be charged.)

“Both campaigns were tracking every night,” Clinton campaign manager Robby Mook said at a Harvard conference in December. “I do think the undecideds broke against us. I do. And they did. I cannot emphasize enough, from the data I was seeing every night, that Comey letter had a huge effect.”

In response, Trump’s campaign pointed out that undecided voters started coming to their candidate in the week before the Comey letter.

But whatever the exact timing, the ISCAP survey bolsters the accounts of a late shift that may have changed the outcome.

“I don’t know what the Trump team was seeing, but we saw both camps consolidating these third-party voters at the end, as normally happens — third-party candidates usually get half of what they are polling a few weeks out on Election Day because your people come home,” Mook said. “After that first Comey letter, that process stopped for us, but it continued for Trump.”