Five years ago Nintendo started unraveling. The company was losing money for the first time ever as the monstrously popular Wii stalled in sales. Nintendo’s savior, a Wii follow-up christened the Wii U, turned into an elaborate act of self-sabotage. The system was poorly named (is that an add-on to the Wii?), poorly conceived (why is the controller a mostly useless tablet?), and poorly supported (where the hell is Metroid?). It became Nintendo’s worst-selling home console ever, and as the company’s losses mounted in 2013 and 2014, it appeared to be on the verge of obsolescence. Last life, no continues.

But Nintendo often mines its biggest successes from spectacular failures. This is the company that pulled the video game industry out of its 1983 tailspin with the Nintendo Entertainment System and developed the motion-controlled Wii as a desperate attempt to recoup its shriveling market share in the mid-2000s. Impending doom always seems to reanimate the industry’s most revered developer.

Maybe it shouldn’t be a total surprise, then, that after managing to lose nearly 100 million customers in the transition from the Wii to the Wii U, Nintendo has once again snagged victory from the jaws of defeat with its latest system, the Nintendo Switch. The handheld-console hybrid has improbably become the best-selling console in many parts of the world and has already accrued multiple titles worthy of GOAT status in fewer than 10 months. Couple the Switch’s success with the highly sought-after SNES Classic, and Nintendo is clearly having its best year in a long time. The company’s comeback is one of the few positive tech stories of 2017.

The year didn’t begin so rosily, though. With the defunct Wii U having sold a paltry 13 million units (compared with the Wii’s 101 million) and the poorly stocked NES Classic having done more to anger gamers than fulfill their nostalgic delights last year, the company needed a win. Badly. A January media event that served as a coming-out-party for the Switch didn’t exactly inspire confidence. Nintendo was light on software announcements or details about its online service, an essential feature on modern consoles. And the revelation that the Switch would cost $300 — as much as the more powerful PlayStation 4 and Xbox One — helped send the company’s stock price down more than 5 percent after the presentation.

It all seemed like enough to burn through the last of gamers’ goodwill for the often maddening company. But then Nintendo released The Legend of Zelda: Breath of the Wild, and a lifetime’s worth of anti-consumer transgressions were suddenly forgiven. In an era filled with cynical IP cash-ins across entertainment, Nintendo used a formulaic, nostalgic franchise to deliver a fresh reinvention of open-world gaming mechanics. The game is an adept mix of old and new, borrowing elements of Skyrim and Minecraft but augmenting them to recreate the whimsy, mystery, and intrepidness that a lot of gamers felt the first time they booted up the original Legend of Zelda or the seminal Ocarina of Time. The gushing praise for the game, the best-reviewed title of the year, proved that endlessly cynical gamers will always have a soft spot for a Nintendo classic done right.

Zelda immediately transformed the Switch from a curiosity to a must-have gadget. Gamers like Yai Torres, a 30-year-old resident of Arlington, Virginia, who had skipped out on the Wii U, got the system the day it launched. “It’s been a while since I’ve had a Nintendo product but I’ve always been a follower in terms of the latest games,” Torres says. “The fact that they had such a cool console with such a cool game clicked for me.”

The Switch selling out at launch was not a shock. Even the disastrous Wii U managed to do that. But when the Switch remained hard to find into the summer months, it was clear that Nintendo had created something special. Part of the appeal is the Switch’s core gimmick — it can be played as a handheld or a television-connected console — which differentiated it from everything else on the market.

That duality felt like a more refined execution of the Wii U’s biggest feature, a tablet controller that allowed for dual-screen gaming or limited handheld play. While the Wii U struggled to attract software that made use of its touch screen, the Switch’s portability is an automatic boon for every game released. The functionality also makes it the heir apparent to not only the Wii U but the 3DS, Nintendo’s previous entry in its successful handheld line. Jill Odom, a 24-year-old resident of Northport, Alabama, who also ignored the Wii U, is considering buying the Switch port of Skyrim simply because she’d be able to take it on the go. “The portability is amazing,” she says. “During Thanksgiving break, when I go home to see my family, I can play Legend of Zelda while I’m up there instead of being like, ‘Man, I can’t wait to go home so I can go play my console.’”

Following the launch, Nintendo proved again and again that its franchises both old and new can still sell systems. A port of Mario Kart 8 released in April is now the Switch’s second-best-selling game. Splatoon 2, the sequel to the colorful kids’ shooter that debuted on the Wii U, has sold more than 3 million copies. Even ARMS and 1–2-Switch, games that elicited shrugs at the company’s January conference, are million-sellers globally. But the system’s centerpiece title post-Zelda is definitely Super Mario Odyssey. Much like Link’s adventure, the game manages to feel novel while retaining the core elements that have made the Mario franchise essential for three decades.

The Switch’s success has surprised not only industry watchers but Nintendo itself. During its years in the Wii U wilderness, Nintendo talked a lot about diversifying its business across multiple platforms, including smartphone games (which have performed middlingly) and a vague “health-based platform” (which has yet to materialize). Now, though, the company has raised its projections for Switch sales this fiscal year from 10 million to 14 million and is rumored to be building as many as 30 million Switches next year. In just a few months, the Switch has become the backbone of Nintendo’s future.

Regardless of the Switch’s success, Nintendo won’t give up diversifying its business model. For gamers who don’t care about the latest Mario or Zelda title, Nintendo has offered the SNES Classic as a go-to holiday gift. The company has promised that the miniaturized retro console will have a larger production run than last year’s hard-to-find NES Classic, and the device has managed to outsell the PS4 and Xbox One in recent months. Upcoming projects like a reported Super Mario movie (animated, thank God) and a Nintendo theme park also indicate the company may finally be finding effective ways to strengthen its brand outside the bounds of traditional console cycles.

Of course, there’s no guarantee that Nintendo’s current momentum will continue. The company is notorious for releasing consoles that struggle to fill out calendars with compelling software over the years, and it’s hard to believe Zelda and Mario will be topped soon in terms of critical acclaim. While Switch is beating expectations, it will need something besides the franchise staples to reach Wii-like ubiquity (that system was propelled in large part by the novelty of Wii Sports). “There’s still a lot of road left to cover,” says Matthew Hudak, a senior toys and games analyst for Euromonitor. “Part of its long-term success depends on whether it can also introduce some other things that can bring in the casual players. … They are banking a little bit more on nostalgia than they were prior with Wii.”

It’s also not yet clear whether the Switch will have a big impact on the rest of the gaming landscape. Sony has said it doesn’t plan to release another handheld after its last one, the Vita, tanked. Microsoft is trying to integrate its Xbox and Windows platforms, not go portable. And while third parties are happy to offer Switch ports of kid-friendly franchises and last-gen remasters, the system doesn’t have the power to support direct ports of today’s biggest blockbuster hits (a problem the Wii and Wii U also had). It’s hard to imagine the Switch spurring the same kind of industry-wide hand-wringing that occurred when the Wii briefly made motion controls seem like the future of gaming.

Perhaps that’s for the best. The Switch is likely to draw less scrutiny and ire if it’s not looking to reshape the way we play games and instead humbly presenting the very best of what Nintendo has to offer, in the living room and on the go. For longtime fans, it’s heartening to see that the company still has the chops to integrate modern game design philosophies with its marquee accessibility. With decades of gimmicks under its belt — some fruitful, others nearly fatal — Nintendo has kept things simple for once. And in a year like this one, simple pleasures have to be treasured. “Nintendo’s brand to me has always been whimsy and childlike wonder,” says Kyle Stapleton, a 30-year-old Atlanta resident who bought an SNES Classic. “It’s a nice respite from all the insanity of 2017.”