Given the simple structure of A Series of Unfortunate Events’ plots, it must have been tempting for Netflix to try to extend the series as long as it could. Sure, author Daniel Handler only penned 13 books in the Unfortunate Events series, but the setup of his plot could inspire any number of additional schemes where the scheming Count Olaf (Neil Patrick Harris) dons some ridiculous costume to try to steal the inheritance of the Baudelaire orphans. But series developers Mark Hudis and Barry Sonnenfeld took a disciplined approach to their adaptation, hewing closely to the novels’ plots, spirit, and timeline. The show’s third and final season, which premieres on January 1st, 2019, is a masterclass in how to build a faithful adaptation, and how to see it to the end gracefully.

Season 3 picks up in the immediate aftermath of season 2’s cliffhanger ending, with the bitey baby Sunny Baudelaire (Presley Smith) in Olaf’s clutches, while her older siblings — scholarly Klaus (Louis Hynes) and brilliant inventor Violet (Malina Weissman) — are sent tumbling down a cliff in a circus train car. Using their talents to escape from Olaf’s evil plots is second nature for the Baudelaires, but season 3 quickly changes the nature of the conflict by introducing Olaf’s menacing mentors The Woman with Hair but No Beard (Beth Grant) and the Man with a Beard but No Hair (Richard E. Grant), who are unimpressed with Olaf’s long streak of failure.

It’s a testament to Harris’ charm and emotive skills that he can so quickly elicit audience sympathy by being undermined by his parental figures and desperately trying to find ways to show he’s worthy of their love and respect. A villain who constantly fails, especially against plucky but not particularly powerful opponents, always has the potential to become pathetic. Having other characters effectively attack Olaf and the premise of the show acknowledges the problem, and starts a season-long arc for the villain, with a spectacular emotional payoff.

The whole season is spent alternately ripping through the status quo by banishing components of the formula like Olaf’s costumes and the cast of recurring but nameless henchmen, while also making constant callbacks to previous episodes. The story is taken straight from the novels, but the ridiculous reunion involving nearly every living person the Baudelaires have met (in the episode “The Penultimate Peril”) is especially evocative in television form, because it also showcases the series’ outstanding cameos by actors including Tony Hale, Joan Cusack, and Patrick Breen.

Harris dominates every scene he’s in, and the show’s young actors are charming in their ability to earnestly deliver lines about impossible inventions and obscure but somehow relevant facts. The supporting cast is excellent as well, with Allison Williams joining the series this season as the fierce adventurer Kit Snicket, sister of series narrator Lemony Snicket (Patrick Warburton), who’s still urging viewers to turn off the show and find happier fare. Olaf’s girlfriend Esme Squalor (Lucy Punch) continues to shine both in her menacing delivery and as the model for costume designer Cynthia Ann Summers’ spectacular outfits, like a skiing costume that makes her look like a phoenix flying down the slope. Olaf’s longsuffering henchman Hook-Handed Man (Usman Ally) gets his own powerful arc that builds on the plot and lets the show pivot away from its sometimes black-and-white divides between good intellectuals and the evil of ignorance.

The series’ already high levels of zaniness and meta-humor are also ramped up this season with episodes that feel like extended tributes to writer-director Wes Anderson. When the Baudelaires are reunited with evil Shirley Temple Carmelita Spats (Kitana Turnbull), she’s leading a troop of Snow Scouts that could be at home in Anderson’s Moonrise Kingdom. A submarine adventure, involving the heroes dodging the perils of the Great Unknown, which manifests as a sea monster, hints at The Life Aquatic with Steve Zissou. Most acutely, there’s the appropriately named Hotel Denouement, which has the pastel palette of The Grand Budapest Hotel and is staffed by twin managers who are identical in every way except their morality. Everything is punctuated with gags like Carmelita showing just how terrible she is by murmuring that she only watches network TV, or Sunny responding to a discussion about the judges of Olaf’s trial interpreting things literally by murmuring “Scalia.”

The goofiness makes a strong counterpoint to the grimmer points of the story. The addition of Olaf’s eviler mentors ups the stakes and the body count as the writers hammer home the series’ moral that no one should trust authority to solve their problems, and that the best intentions can be all too easily corrupted. While the final episode brings the characters emotional catharsis, and explains the last mysteries, Netflix’s version of A Series of Unfortunate Events is never better than the final scenes of “The Penultimate Peril,” where the Baudelaires repeatedly urge groups of blindfolded adults to flee a fire, and get rebuffed for absurd though law-abiding reasons.

As the Baudelaire’s saga draws to a close, the writers also further develop Snickets’ story, digging into the secret society that collapsed, setting the series’ events in motion. The show doesn’t bring all its subplots to a fully satisfying conclusion, but there are enough clever reveals to show Handler’s vision and memory, and the advantage the show’s writers gained by hewing so closely to it. Handler went on to pen a prequel series to A Series of Unfortunate Events, so it’s possible Netflix isn’t done with his stories yet. That seems even more plausible, given that the show never wore out its welcome by attempting to stretch the material past its natural end point. Netflix’s adaptation succeeded by staying true to the characters, concepts and tone, bringing the tragic story of the Baudelaire children to life with visual whimsy and genuinely heartfelt performances. It’s worth watching all the way to the final episode, which is appropriately called “The End.”