Bernie Sanders endorsed Hillary Clinton on Tuesday, acknowledging that Clinton won the Democratic nomination and effectively ending his presidential campaign. While I was skeptical of his chances at nearly every turn of this campaign, don’t expect schadenfreude here. Instead, let’s celebrate a candidate who far exceeded most expectations, discuss his legacy and what Sanders’s success means for the future of the Democratic Party.

But let’s start by talking about that success. The first thing to note: Sanders came a long, long way. He began the primary trailing Hillary Clinton by 57 percentage points in national polls. In the end, he lost the national primary vote, in aggregate, by only about 12 points. He closed the gap by 40 percentage points. No candidate since 1972 started that far down to a front-runner and came so close to winning.

Sanders started the primary campaign by nearly pulling off an upset in the Iowa caucuses. When Sanders announced his bid, Clinton led in the Hawkeye State by 54 percentage points. In the final Iowa polls, she was 5 points in front of him. And he lost the state by less than 1 percentage point. From there, Sanders romped in the New Hampshire primary, cruising by 22 percentage points. Sure, he represents New Hampshire’s neighbor, Vermont, in the U.S. Senate, but it’s important to recognize that he started down 40 percentage points in the Granite State. That is, in Iowa, New Hampshire and other contests, Sanders demonstrated an ability to close the gap on Clinton the more he campaigned.

Perhaps where Sanders impressed most is what he did after Iowa and New Hampshire, two states that we knew would be favorable for him. He won contests into June — even after Clinton amassed a nearly insurmountable advantage in delegates — for a total of 22 wins (out of 57 contests). Sanders did this well even with virtually all party elites lined up against him. His campaign was powered almost entirely by the grassroots.

Of course, election results are only one way to measure a candidate’s success. I had argued before the primary that Sanders’s biggest impact might be to push Clinton further to the left on the issues. The jury is still out on how much Clinton changed her rhetoric versus her actual positions (see: the $15 minimum wage), as Dave Hopkins of Boston College pointed out. Still, there can be little doubt that Sanders changed how issues were talked about during the campaign. Clinton didn’t try to beat Sanders by tacking toward the center, as Al Gore often did when Bill Bradley challenged him in 2000. Rather, Clinton highlighted issues where she was further left than Sanders, such as gun control.

Sanders’s greatest effect on Clinton’s positioning may have been on trade. Clinton entered the race having once called the Trans-Pacific Partnership free trade agreement the “gold standard.” She ended up against it, even though President Obama, whom she hugged closely throughout the campaign, was pushing the agreement. Sanders was resolutely against TPP, and Clinton ultimately flipped to Sanders’s side of the issue. Sanders also got Clinton to back free college tuition at state colleges and universities for all but the top of the income distribution.

Sanders scored victories when it came to the Democratic Party platform too. The platform, which still has to be ratified at the convention, includes provisions in favor of a $15 minimum wage indexed to inflation and a commitment to end the death penalty — positions that Clinton did not favor during the campaign.

Still, Sanders didn’t win the nomination. He lost by over 10 percentage points to Clinton, falling behind in the pledged delegate count after the third contest (Nevada) and never coming back from that deficit. The question, therefore, is what Sanders’s success means for the future.

It’s possible that Sanders’s strong bid for the presidency marks a turning point for the American left. We’re now more than 25 years after the fall of the Berlin Wall, and the word “socialism” doesn’t seem to be the dirty word it once was. According to a May Gallup poll, 58 percent of Democrats and Democratic-leaning independents have a positive image of socialism.

That comes on the heels of the Occupy Wall Street movement, which gained a lot of press and changed the nation’s political discourse even if it didn’t seem to play in the electoral system in the way the tea party did.

Whatever the label, Sanders took advantage of a Democratic primary electorate that has become more liberal. The share of 2016 primary voters who called themselves “very liberal” was up 8 percentage points versus 2008, as of late April. The percentage of “moderate” and “conservative” Democratic voters, combined, was down 15 percentage points. The leftward lurch of the Democratic electorate suggests we haven’t seen the last of Sanders-like progressives.

Moreover, any Sanders-type candidate thinking about running for president in the next couple decades should be heartened by this fact: The Vermont senator’s most supportive group was young voters. From the Iowa caucuses, where Sanders won 86 percent of 17-to-24-year-olds, to New York, where he won 81 percent of 18-to-24-year-olds, Sanders did considerably better with young voters than he did with the electorate as a whole. He did better with them in many of these states than Obama did eight years ago.

When you combine the swelling liberal wing of the Democratic Party with the ability to raise money at a record pace online, a left-leaning optimist might reasonably conclude that the sky’s the limit.

The pessimistic viewpoint, however, is that Sanders’s respectable second-place finish is the best-case scenario for an anti-establishment Democratic socialist. That he really never had much of a chance of winning and a future Sanders like candidate has a lot of work to do in order to win.

Let’s start with the most obvious problem that Sanders ran into: He never caught on with black voters and didn’t improve with them as the primary season went on. Black voters are the base of the Democratic Party. Clinton lost without them in 2008 and won with them in 2016. Clinton won every state where black voters made up at least 10 percent of the population, except for Michigan. In the North, Clinton regularly won black voters by 40 to 50 percentage points. In the South, she regularly won them by 70 to 80 percentage points. When you’re losing by this wide of a margin among a voting bloc that makes up somewhere between 20 and 25 percent of your party’s voters, your candidacy is going to have a hard time winning.

Sanders also struggled tremendously with Latinos, who are growing as a percentage of eligible voters. Sanders lost every contest, except for Colorado, where Latinos made up at least 10 percent of the voting eligible population. Further, as my colleague Nate Silver calculated, Clinton won 16 of 17 districts where Latinos made up a majority, beating Sanders by an average of 32 percentage points. Simply put, the two most consequential minority blocs in Democratic politics didn’t feel the Bern.

What about the idea that Sanders’s success is a sign that Democrats have an insider/outsider problem, similar to the GOP’s, where rank-and-file voters (particularly young voters in the Democrat’s case) disagree with and even distrust party elites? Are young voters really going to follow through on voting for anti-establishment figures as they get older? It’s certainly possible, but don’t assume it will happen. Younger voters were the force behind George McGovern’s winning anti-establishment crusade in 1972, but this same age cohort — now in their 60s — was squarely behind Clinton in 2016. There’s also no sign that Sanders voters dislike the status quo all that much. Sanders’s young voters also overwhelmingly approve of the job Obama is doing.

Indeed, it’s more plausible that someone in Obama’s mold, rather than Sanders’s, represents the future of the Democratic Party. If the best Sanders can do — even when he gets a clear one-on-one shot against Clinton and doesn’t face a single negative ad from the front-runner — is to lose by double-digits, then maybe we shouldn’t read anything drastic into his 2016 campaign. We’ll have to wait and see.

For now, we know this much: Sanders ran a great campaign and found a lot of support, even if it wasn’t enough to become the nominee.