Star Trek Beyond is, for lack of a better description, the goods.

When I walked out of the JJ Abrams reboot in 2009, I was giddy about the potential for the series. I thought they did a terrific job casting the film, and by the time the movie ended, they were set to head out into space on their five year mission, seeking out, boldly going, and it felt like they had wiped the slate clean as storytellers so they weren’t beholden to anything anymore other than the characters.

That’s what made Star Trek Into Darkness so confounding. I think there’s great energy to the filmmaking, which I liked when I first saw it, but I’ve never seen a movie more tied in knots to try to trick an audience, and for so little payoff. The moment they decided to make a movie that hinged on Khan as a villain, they painted themselves into a narrative corner, and they never figured out how to get out of it. I thought the film was nearly impossible to review, because it was so much technical skill and so many great actors all in search of a story worth telling. It may not have helped that Roberto Orci’s own politics ended up wedged into the film’s “false flag” storyline, which might have worked if that had been the whole film, but which feels wildly out of place wrapped around the slavishly inverted Wrath Of Khan remake.

One thing is clear with some distance from both of those films. The first one is a keeper, and the second one simply isn’t. The good news, then, is that Justin Lin’s Star Trek Beyond is a direct sequel to the 2009 film, and as close as we’ve seen in a long time to a straightforward episode of the original series. It just happens to be on a scale that eluded the show, but it still feels to me like Star Trek, from the tap, undiluted and nerdy and fun. Much of that credit has to be given to Simon Pegg and Doug Jung, whose script lays a better foundation than most big blockbusters ever have to work from, and it is clear that they dearly love these characters and the things that define Star Trek as Star Trek.

But what things are those, exactly? Because 50 years after the first episode of the first television incarnation of Gene Roddenberry’s sprawling science-fiction universe, the definition has expanded beyond anything he could have imagined on his own, and I suspect that’s the entire point of it. I know people who prefer Next Generation to the original series, people who think Deep Space Nine is the best of the bunch, and there are people who only really know the movies, and not even every single one of those. There’s no one way to watch or enjoy Star Trek, and there’s no one type of story that defines it. For me, though, the original group of characters is still my favorite, which is one of the reasons I enjoyed the notion of starting over with younger version of Kirk, Spock, McCoy, Uhura, Sulu, Scotty, and Chekov. There’s a genius to that particular combination that wasn’t even fully in place when the original series began. It was only gradually that the core ensemble was cemented, and I’d argue it wasn’t until they started making films that we saw people really take full advantage of the various dynamics that you can create between those various characters.

Star Trek Beyond opens about midway into the five-year-mission, and right away, I felt like I was in good hands. One of my favorite things about Chris Pine’s take on Captain Kirk is that he looks like a cookie-cutter action hero, but he is a doofus through and through. I think Pine is very good at deflating his own persona, and his opening sequence here is among his funniest. Once he’s back onboard the Enterprise with his crew, though, the film shifts gear, and I’d say we get one of the best-written sequences in any Star Trek film ever, a long lingering look at the reality of life onboard a ship that spends years away from home. The ship is on its way to a rendezvous with the Yorktown, a gigantic deep-space starbase that looks like it was co-designed by Neill Blomkamp and M.C Escher. It’s a gorgeous realization of a big weird science-fiction idea, and seeing the Yorktown underlined for me how optimism is a key part of what distinguishes Star Trek. I want to believe that we will reach the kind of future that Star Trek imagines, where we’ve moved beyond the terrible divisive politics that define us on this planet and embraced a unity that defines us off this planet. I like that future. I like how completely Star Trek has always emphasized that possible future, and it’s absolutely key to what makes this film work.

A very simple encounter leads to the Enterprise being sent to investigate a mysterious event, and from that, everything else spins out. The less I tell you about Krall (Idris Elba), Jaylah (Sofia Boutella), or the planet where the Enterprise crew encounters them, the better. There’s a brisk sense of invention to the film, and it feels like it is breathlessly told, something that is due in large part to Justin Lin, who has been developing a very particular approach to blockbuster filmmaking. Yes, he’s fine with the big action mayhem that is par for the course with these films, but he understands that the thing that makes any of it interesting is making sure the audience really enjoys spending time with these characters. He’s one of the reasons the Fast & Furious franchise turned around so dramatically, and by the time he stepped away from that series, he had helped to perfect a template that they’re going to follow from now on. This film puts the beloved Enterprise crew front and center and then blows them apart to see what happens. It’s a smartly structured film, allowing for some of the cast to be paired off into great smaller groups. Chris Pine and Anton Yelchin’s Kirk and Chekov are stranded together, and there’s a great sense of Chekov helping remind Kirk why a captain is important to a crew. He is someone they depend on and look to for guidance and who has to be able to be the person that he wants all of them to be as well. He must be an example, and seeing how clearly Chekov needs that, he rises to the occasion at a moment when he needs to do exactly that.

Even better, Bones (Karl Urban) and Spock (Zachary Quinto) spend a good deal of the film isolated together, and both actors have so completely settled into their skins, and they play the characters with such precision, both emotionally and comedically, that it feels like they can’t go wrong. Everything they do together is gold. It not only pays off 50 years of groundwork laid by the show and the films, but it also finally fully pays off the chemistry that Urban and Quinto have together. Scotty (Simon Pegg) does indeed once again have his little buddy Keenser (Deep Roy), who is strange and disturbing as always, but he also is the one who spends a good deal of time with Jaylah, the film’s best new invention. Sofia Boutella made a strong impression in her supporting role in Kingsman: The Secret Service, and she’s currently playing her biggest role yet as the title character in The Mummy, but this is the moment where she really snaps into focus as a performer. She’s great in Star Trek Beyond, and Pegg seems to be constantly delighted by her as a scene partner. Self-reliant, physically imposing but not absurdly superheroic, and as smart as she is determined, Jaylah helps Scotty start to piece together the film’s central mysteries.

Those mysteries revolve around Krall, the Idris Elba character, and while I think they could have been more elegant in the way they connected the dots about him, I like the character and the general ideas driving him. Elba gives Krall a bruised brutality, and like any good villain, it’s clear that he doesn’t see himself as a villain at all. What he wants and why he wants it makes sense, and there’s a sadness to his particular arc that made him feel like something more than just another snarling blockbuster bad guy. The film does suffer some from being a “glowing doodad on a roof” movie, but I’ll give them credit for staging one of the most inventive versions of the rooftop fistfight to end one of these movie that I’ve ever seen. By the time the film wraps up, not only have they paid onscreen tribute to the legacy of the great Leonard Nimoy, but they’ve also paid an accidental but moving tribute to Anton Yelchin. It is a film that fully acknowledges that it is meant to serve as a 50th anniversary celebration as much as a movie, and it does so by telling a good Star Trek story with an extra-careful emphasis on great Star Trek characters. Michael Giacchino remains my favorite currently working big movie composer. His original Star Trek theme is one of the best pop themes in a while, and the way he leans into the earlier themes in this film is beautifully done. Everyone appears to have brought their A-game in the tech departments, and it’s a gorgeous SF adventure on a purely visual level.

If you’re even remotely interested in a new Star Trek film, this feels like everything you could have asked for. Here’s hoping the great adventure continues for another 50 years from here.

Star Trek Beyond opens in theaters everywhere on Friday, June 22.

A respected critic and commentator for fifteen years, Drew McWeeny helped create the online film community as "Moriarty" at Ain't It Cool News, and now proudly leads two budding Film Nerds in their ongoing movie education.