For once, the mainstream media got it exactly right. Hillary Clinton’s victory in South Carolina represented more than just a defeat for Bernie Sanders, it was a rout that does not bode well for his campaign, or his message, in states across the South.

Clinton won the state by 175,000 votes—a wider margin than Barack Obama in 2008. According to exit polls, Clinton also exceeded the president’s share of the black vote, winning 87 percent to Obama’s 55 percent (although that was against two other candidates). While there is no other state where African-American voters make up as much of the Democratic electorate as they do in South Carolina—62 percent, also a higher proportion than in 2008—minority voters potentially hold the balance in Alabama, Arkansas, Georgia, Tennessee, Texas, and Virginia, states that all just happen to be voting on Tuesday.

So as tempting as it might be for Sanders, and his supporters, to draw a line under the debacle and move on to greener pastures—as indeed the senator himself began doing even before the voting began—that would be a potentially fatal mistake. South Carolina was not a state the Sanders campaign conceded; he had eight offices in the state and some 200 paid staffers. He also spent $1 million in advertising, only to finish 47 points behind—far worse than any recent poll had suggested. Successful politicians learn from their failures, and the results in South Carolina indicate that Sanders has a lot to learn. Fortunately—and despite what you may read over the next week—there is still time. So here are six lessons to be drawn from this disaster:

  • Cultivate local knowledge. The Rev. Jesse Jackson won South Carolina twice, and Kevin Gray ran both those campaigns. Gray, who was in the room when Bill Clinton attacked rapper Sister Souljah, was never going to support Hillary. Indeed, when I spoke with him in the fall, he said he’d probably vote for Sanders; by February, Gray’s alienation and frustration had reached the point where he told Sirius XM’s Mark Thompson he was considering going third party.
  • Sanders has a gender problem. As Gray pointed out, women made up 60 percent of the black electorate in South Carolina, yet the Sanders campaign used almost exclusively male surrogates from outside the state: Cornel West, Killer Mike, Keith Ellison. Even the local politicians given name checks by Sanders in his concession statement—“Terry Alexander, Justin Bamberg, Joe Neal, Wendell Gilliard, Cezar McKnight, Robert Williams, and former Democratic Party Chairman Dick Harpootlian”—were all men.
  • He also still has a race problem. The media often act as if African-American voters were fungible, i.e., interchangeable, when the reality is as varied and complex as among whites or any other group. Sanders must hope that urban voters in Detroit or Atlanta or DC differ from the largely rural voters of South Carolina. Yet, so far, he has shown an unwillingness—or an inability—to tailor or target his message, relying on consistency and his long history of engagement with civil-rights struggles to win over black voters. That strategy clearly failed in South Carolina. As David Graham put it in a superb analysis in The Atlantic, voters felt Clinton “knew them and their people—not just the statistics, but the people. Sanders speaks to racism; Clinton speaks to black people.”
  • Learn to counterpunch. While both Democrats need to avoid giving the Republicans material to use in the fall, Sanders can’t afford to let Clinton keep painting him as a marginal malcontent—and herself as Obama’s heir. It’s true that much of the Sanders campaign’s energy derives from a sense that Obama hasn’t gone nearly far enough to arrest America’s slide toward oligarchy—or the corrupt political system that disenfranchises so many. But Clinton used every Sanders demurral to drive a wedge between him and black voters—while making no firm commitments that might prevent her from going #BackToTheIssues once the primaries are over.
  • Don’t confuse campuses with communities, pandering with politics—or Reddit with reality. The Clintons are past masters at targeted pandering, but they are also very, very good at retail politics. When Hillary Clinton speaks to a group—of any size—she begins by name-checking the local machers: elected officials, party functionaries, local worthies. Sanders never does this. And what South Carolina proves is that those may be the very people who can deliver voters to the polls. SouthCarolina4Sanders had 675 readers; his Facebook group in the state had 24,894 likes. Millennials love Bernie Sanders, but they aren’t going to win him the nomination.
  • Don’t expect a fair fight. The Clintons have more than 20 years of history with Democratic voters, and there is no way for Sanders to compete with that. Or, apparently, to persuade African-American women to abandon Hillary. For the next week or two, the news is not going to be good for Sanders supporters. But this can—and should—be a long campaign. Nor is the nomination—or November—necessarily the finish line. Sanders says he wants to bring about a political revolution, to turn the system that currently works for the benefit of the wealthy and the powerful upside down. Which means he, and we, should expect every setback to be magnified, every achievement diminished or dismissed. All the more reason to analyze our failures, and to be nimble, not numb, going forward.