Spoilers for Star Trek Beyond follow.

Star Trek Beyond is, as we lazily say in the critical field, not perfect. What film is? But Beyond’s imperfections take a back seat to what does work - the characters, the tone, the fun action, the killer use of Sabotage. Star Trek Beyond, flaws and all, is the best and most Star Trek of the Star Trek reboot movies.

But there is one choice that, had writers Simon Pegg and Doug Jung approached it differently, could have made Beyond a truly great Star Trek film. As it stands it’s a good one - a very good one - but a simple change at the end of the movie would have transformed Beyond into a truly classic Trek tale.

The main villain of the piece is Krall, played by Idris Elba. At first we think that Krall is an alien who has a beef with the United Federation of Planets, but as the movie goes on we learn that looks can be deceiving - under all that make-up is a human, the captain of the ill-fated USS Franklin. And we further learn that Krall, once known as Balthazar Edison, hates the Federation because he thinks its peaceful ways are making humanity weak. Once a soldier, he has seen the warlike elements of humanity replaced by the more enlightened, but he can’t adjust. Being given the helm of an exploratory ship is just another disgrace to a man who found his true calling in combat.

This creates, in true Trek tradition, an exciting philosophical argument between our heroes and the villain. Krall hates the Federation on a profound and foundational level, and what’s more he believes that the Federation’s guiding principal - strength through unity - is a sham. Against him is Captain Kirk, who has found himself not quite in the same place Krall is but still adrift. After three years in deep space, Kirk isn’t sure that he’s really the guy who should be exploring and all that. He doesn’t feel like he’s in step with his own job. Through his conflict with Krall Kirk comes to recognize what he loves about his crew, about his ship and about his role in the Federation.

But what does Krall come to learn? Nothing at all, it seems.

One of the great hallmarks of the original Star Trek TV series was that Captain Kirk would often out-talk his opponents. It’s almost a Trek cliche that Kirk would talk a computer into a complete logic meltdown. Co-writer Simon Pegg knows how to do this - he used it for the ending of The World’s End, which he co-wrote with Edgar Wright. In that film Pegg’s character pulls a complete Kirk, out-talking an alien intelligence and making them decide to fuck off of Earth rather than deal with him anymore, and at the time I noted that this was a perfect Trek ending, better than the Trek reboots had managed to date.

And yet Pegg and Jung didn’t go there in Beyond, despite it really really looking like they would. At the end of the movie Kirk and Krall have a cool zero gravity fight while Krall is attempting to unleash a biological weapon on the space station Yorktown. Kirk is struggling to open little boxes to activate a huge fan that will suck Krall and the weapon out into space, and he comes to the last box but cannot get it open. Meanwhile, Krall, who had been knocked out, comes to and sees his reflection in a floating shard of glass. At this moment Krall looks more like Balthazar Edison than he has for the rest of the film, and we take it that he looks more like Edison than he has in a hundred years. That moment, coupled with Kirk’s arguments against him, opens the door for a classic Star Trek finale - Krall floating up to aid Kirk and sacrificing his life in the process. It would be a triumphant ending, one that would complete Krall’s story arc as he comes to his senses and realizes that conflict isn’t always the best way.

Except that isn’t what happens and they fight and then Krall gets sucked out unwittingly into space and dies.

It’s not a huge problem, but it’s a bummer. It’s just not the right ending; the fact that the movie plays with Krall looking at his reflection indicates to me that either a) there was once an ending where Krall does sacrifice himself or b) there’s an attempt to subvert the “Kirk talks the villain to death” trope. But subverting that trope is meaningless here, as it has never existed in the reboot universe.

That’s the one thing I would change about Star Trek Beyond. The movie has other flaws and problems, but it’s the resolution of the Krall story that’s the true stumble in the landing. All of the other problems in the film I can gloss over, get past, give the benefit of the doubt - the death of Krall is harder to ignore.

But still, so very close to being great is much better than Star Trek Into Darkness being light years from greatness. I’ll take this stumble any day.