On the whole, I’m not the biggest fan of the X-Men movies. My personal favorite is X-Men: First Class, but overall I find the so-called “good” contributions to be pretty average or to have not aged gracefully—and yes, I’m including X2 and Days Of Future Past in that sentiment. So keep that in mind when I say that Logan is absolutely fantastic. This is a film that takes a couple of the most beloved characters of the X-Men mythos and shows us a tragic and very real side of them, which is oddly refreshing after years of watching Fox try to chase Marvel’s brand of poppy success to little avail. If the route going forward is to make R-rated character studies like Logan, then maybe there’s some hope for the X-Men Cinematic Universe after all.

Set in 2029, a time when nearly all of mutant kind has been wiped out and no new mutants have been born in many years, Logan (Hugh Jackman)—looking very gray and not healing as well as he used to—is working as a limo driver near the Mexican border to save money to care for an ailing Charles Xavier (Patrick Stewart), whose declining mental faculties coincide with a waning control of his immense psychic abilities. A distressed woman tracks Logan down and offers him a job to transport an adolescent girl, Laura (Dafne Keen), up to Canada as she is being pursued by corporate mercenaries. Logan begrudgingly agrees, only to discover that Laura is actually a mutant with healing powers and adamantium claws much like his own.

Read more: Get Out is a modern masterpiece of both satire and horror

All of this plays out like some sort of Wolverine Western, which is an incredibly clever genre exercise that would feel even more clever if it didn’t feel the need to constantly bring back cowboy motifs. But all of this is secondary to a very tight script that emphasizes the troubled lives of mutants as their kind has been hunted to extinction. Jackman has always been pitch-perfect casting as Wolverine, as has Stewart as Professor X, but seeing both these characters in their twilight years curse and spit at one another in a perpetual state of unrest is shocking as it is fascinating. These characters have been lived in for nearly two decades, and if this is the last we’re to see of these actors filling these roles, they have exited on a high note.

The real breakout, though, is Laura, who comic nerds may know better as X-23. For what is largely a non-verbal performance, Keen invests Laura with so much bad-ass personality and intensity that she is going to be an instant favorite with the young women lucky enough to have parents who will bring them to see this movie.

And those will have to be some especially cool parents, because this flick is a hard R. Not only is there a very liberal use of F-bombs—particularly disconcerting when coming from the mouth of the kindly Professor—but the violence is turned up to eleven as Logan uses his claws to dismember and decapitate waves of humans who stand between him and his objectives. It’s all so starkly and intensely photographed that it’s amazing to even consider that it exists in the same cinematic universe as its family-friendly predecessors, but this is a darker story that necessitates the heavier visuals and themes, so I must applaud Fox for taking a chance on this bloody spectacle.

Read more: John Wick: Chapter 2 proves that lightning can strike twice

And, of course, it wouldn’t be an X-Men movie without loads of subtext about discrimination, racial superiority, and eugenics, but Logan is smart enough to let those themes exist as background elements in a history that is only alluded to rather than made the central focus. I’m sure the lore of how the mutants were wiped out is very interesting, but director James Mangold is smart enough to know that the core of this story is in the character drama, and we’re allowed to piece together the snippets of backstory as necessary rather than be treated to an expositional dump. In a cinematic climate that is becoming increasingly obsessed with continuity—and in a franchise notorious for its failure to adhere to continuity—Logan stands out in how effectively it stands alone.

So, other than a few nitpicking details, I absolutely loved Logan. It’s a dark, fascinating character study that treats its characters with an intelligence and maturity that has been lacking in the X-Men films practically since their inception. Let’s just hope that Fox takes the right lesson from this and decides to produce products of equal intelligence, rather than relying entirely on blood-soaked R-rated spectacle to carry their sole bankable superhero property.