The blue wave, Twitter screamed all night, did not happen.

Democrats took back the House with a resounding lead in the popular vote and won at least 21 out of 35 Senate seats. They made big gains in states across the nation, from New York to Wisconsin to Texas. The overall swing from Republicans to Democrats is the largest since 1948.

And yet, continued Republican control of the Senate, and the high-profile losses of charismatic Democrats running in traditionally red states have somehow added up to a surprisingly defeatist narrative: America is more Trumpist than we thought. We are all doomed.

I am not usually known for an excess of optimism. But that analysis strikes me as deeply—and dangerously—wrong. Far from showing that Trump is secretly popular, or that Democrats have once again failed to fight for their values, the midterms should be seen as a historic rebuke for the president.

So here, to unskew the paranoid interpretation of the election before it gains the power to lead us astray over the coming years, are seven big pieces of good news from Tuesday’s midterm elections.

1. The Polls Were Right All Along

Polls consistently show that a very large number of Americans strongly disapprove of Donald Trump’s performance on the job. In FiveThirtyEight’s average, he has not dipped below 50 percent disapproval since March 2017. And yet, I, like so many others, have for the past two years been haunted by the persistent fear that we might still be underestimating his popularity.

Tuesday’s election results may be a scandal by the standard of justice and decency, but they are a triumph by the standard set by other authoritarian populists around the world.

There were, after all, plenty of reasons to worry. Trump evidently succeeded in shaping the political agenda. He captured the allegiance of a large majority of traditional conservatives. He was buoyed by a booming economy. Since the polls had significantly underestimated him once, it was only natural to wonder whether they might still be underplaying his support.

Today, we know that this is simply not the case. By and large, the polls proved to be strikingly accurate. Democrats were predicted to do well; they did even better.

And that should come as a huge relief to anybody who, in some part of their soul, feared that Trump might, despite all appearances, be playing three-dimensional chess.

2. Trump Is Not the Face of America

Given how horrendous Trump’s words and the deeds have been over the past two years, it’s only natural that many liberals hoped for a total and complete repudiation of him. To them, it is a scandal that Republicans won any contested races at all. How, they understandably ask, can so many of their fellow citizens stand by the president’s bigotry, his shameless lies, and the blatant disregard for the Constitution?

I, too, wish that we had succeeded in building a deep and broad consensus against Trump over the past two years. But it has now been obvious for a very long time that, though Trump remains unpopular with most Americans, he has succeeded in retaining the fervent support of a large minority of them. And if we compare Trump with authoritarian populists in other parts of the world, that should hardly surprise us: When Viktor Orban, Recep Tayyip Erdogan, Hugo Chávez, and others were challenged at the ballot box, especially during their first years in office, they usually won. So while Tuesday’s election results may be a scandal by the standard of justice and decency, they are a triumph by the standard set by other authoritarian populists around the world.

One part of the reason for this is that, as I have argued before, Trump has never been the most disciplined or effective of populists. If there were a populist Olympics, he would, as the midterms once again demonstrate, not make medal rank.

Another part of the reason is that Trump is less in tune with the “real” America than both he and (paradoxically) some of his loudest detractors claim. For all of his undoubted support, a vast swath of America clearly cannot stand him. This includes the first-time voters and people of color who turned out in record numbers. But it also includes the white, middle-aged suburbanites who turned on the Republican Party at an unprecedented rate.

3. The Senate Was a Success

Republicans not only kept their control of the Senate; they added some seats to their column. Surely it is absurd to claim that this represents a success for Democrats?

Actually, no, it isn’t.

Consider the steep odds Democrats were facing: Because they had done extremely well six years ago, when Barack Obama resoundingly won a second term, it was always going to be difficult to defend some of the Senate seats that were up for re-election on Tuesday. Going into the night, Democrats held 26 of those seats, including ones in deep-red territory like Indiana, Missouri, Montana, North Dakota, and West Virginia. To win a majority in the Senate, they would have needed to win 28 out of 35 races.

Clearly, Democrats fell significantly short of that ambitious goal. But they did (as Larry David might say) do pretty, pretty, preeeetty well. By the end of the night, they had won 21 seats, with another three still too close to call, and tallied up a big lead in the popular vote.

Even though the Senate is, for the time being, more firmly in Republican hands, this puts Democrats within striking distance of winning the upper chamber two years hence. For of the 34 seats that will be up for election then, at least 20 will be held by Republicans. If Democrats win half of the seats that are up for grabs in 2020—a far smaller proportion than they won this year—they would gain an overall majority. That will be difficult. But it’s hardly impossible.

4. The Midwest Is Not Lost to the Democratic Party

After Trump romped to victory in 2016 by unexpectedly winning states like Pennsylvania, Michigan, and Wisconsin, it was tempting to think that America’s electoral map would never be the same. Just as the white working-class had abandoned center-left parties for the populist right all across Europe, so too would heavily blue-collar states in the Midwest firmly move toward the Republican column. In order to win in 2020, the argument went, Democrats would need to pick up traditionally Republican states with a growing minority population, like Georgia or even Texas.

The midterms have called that conclusion in doubt for two reasons, one bad and one good. The bad reason is that Democrats performed a little worse than expected in the states in which they had hoped to make real progress: Despite running an inspiring campaign, and making real progress, Beto O’Rourke did not unseat Ted Cruz in Texas. And despite succeeding in mobilizing their base, Andrew Gillum and, most likely, Stacey Abrams failed to win governors’ races in Florida and Georgia. If Democrats are counting on demographic change to push them across the finish line in 2020, they are likely to fall short.

The good reason, meanwhile, is that it is evidently more possible to win back the Midwest than many believed. Indeed, some of the night’s most impressive Democratic victories came in states that Trump had dominated just two years ago. In Wisconsin, Tony Evers beat Scott Walker, the Republican governor who has been most aggressive in implementing a deeply conservative agenda in a once solidly blue state. In Kansas, Laura Kelly beat Kris Kobach, the Midwestern governor most closely aligned with Trump. Democrats also did very well in Midwestern Senate races, romping to victory in Minnesota, Pennsylvania, and Wisconsin, and celebrating important wins in Michigan and Ohio.

The lesson from all of this is by no means that Democrats should give up on winning Southern states with rising minority populations in 2020. Without a doubt, one of their paths to victory is to flip states like Arizona, Florida, and North Carolina. But it does mean that they have a second path of victory as well: Democrats can also oust Trump from the White House by regaining states in which they have traditionally done well, including Pennsylvania, Michigan, and Wisconsin.

5. Swing Voters Are Alive and Well

The major parties ran two very different strategies in this election.

Republicans firmly played to their core supporters. From the open partisanship of Brett Kavanaugh to Trump’s rhetoric about illegal immigration, they took a far-right stance designed to mobilize the base. This tactic may have helped them pick up Senate seats in deep-red territory like Indiana, Missouri, and North Dakota. But it also alienated moderate, suburban voters who swung to Democrats in huge numbers.

Democrats, on the other hand, pursued a much less unified strategy. Some candidates, especially in safe districts, ran robustly progressive campaigns. But others, especially in swing districts, managed to appeal to moderates without being milquetoast: They promised robust action on wages and health care, for example, and were unwavering in condemning Trump’s racist rhetoric. But they also appealed to the middle by emphasizing what Americans have in common and avoiding talk of socialism or revolution.

For one simple reason it will be hard for Democrats to replicate that success in 2020: During a midterm election, the opposition party does not really have an obvious leader. This is often seen as a problem, as when Democrats were accused of lacking a clear message over the past months. But just as often, it is an electoral boon, both because the “Generic Democrat” often polls better than any particular Democrat and because it gives local candidates greater liberty to tailor their message to their particular district.

Even so, the midterms show that a pure logic of base mobilization usually fails. And that should remind Democrats that they do best when they don’t feel that they have to choose between persuading moderates and mobilizing liberals. Doing both of these things is never easy; but as I’ve argued recently, it is very much possible.

6. It Doesn’t Take a Genius to Beat Trump

There is a huge danger to complacency.

Both Bill Clinton and Barack Obama suffered big setbacks in their first midterms before winning re-election with comfortable margins. Trump is clearly unpopular among most Americans, but as 2016 taught us, Democrats can manage to be even less popular than him. Anybody who thinks that 2020 is in the bag because of what happened on Tuesday is clearly out of their mind.

But there is also a huge danger to defeatism.

The midterms show that Trump is deeply vulnerable. He knows how to mobilize the base but not how to appeal to moderate Americans. And so the Republican Party has, under his leadership, been trounced by leaderless Democrats with a muddled message.

So Democrats run two big dangers in 2020: They won’t win if they embrace a politician who is far outside the American mainstream. But nor will they win if they run a gray candidate who does not inspire hope or confidence. Finding a candidate who avoids both of these pitfalls may be difficult—but, as Democratic victories all across the country have shown on Tuesday, it is far from impossible.

7. There Is Finally a Check on Trump

The most important piece of good news coming out of the midterms is also the most obvious one.

Ever since Trump got elected, the biggest danger has been that he might prove capable of weakening the country’s checks and balances, and destroying the rule of law. This danger is by no means banished after the midterms: In the short run, the Republican Party is likely to stay loyal to him. The party’s enhanced control of the Senate will give it an even greater ability to place partisan loyalists in the judiciary. There is a real risk that Trump may finally fire special counsel Robert Mueller in the coming months. And if he does do that, there is a real risk that the FBI could become more and more politicized.

And yet, the Democrats’ clear majority in the House will help to protect American democracy from some of the most blatant forms of executive overreach for the next two years. Any legislation to expand the powers of the presidency will surely be quashed in the House. The chamber’s considerable subpoena power will help to provide accountability. And investigations into presidential misdoings that have so far been a well-orchestrated sham will finally be pursued with seriousness and urgency.

The fight against authoritarian populists is never easy. Anybody who expected that the midterms could magically cure the country’s deep political problems has not been paying attention. But there can be no doubt that Tuesday’s election was the best piece of news for American democracy since Election Day 2016.

With the House under Democratic control, we have more tools to stand up to Trump. The president remains deeply unpopular. And we have every chance of beating him in 2020. So let’s take a day or two to celebrate this great success—and then get back to the hard work of defending our ideals and our institutions against the dangerous authoritarian populist who will remain in the White House for at least another two years.