(Note: the following review contains no spoilers, but some of the links do, so follow them at your own risk if you have not seen Doctor Sleep.)

Doctor Sleep coincidentally arrived in theaters at the same time HBO is airing a similar continuation of a decades-old story, Watchmen. Neither of these stories is really a “sequel” as the term is commonly understood, but more like an extension and revision of the original, penned more than three decades later. Unlike the Watchmen series, Doctor Sleep is based on a book written by the same author, and it serves as Stephen King’s last word on Stanley Kubrick’s masterpiece 1980 adaptation of The Shining, which King loathes.

As with Watchmen, the makers of Doctor Sleep had to decide whether the original book or its filmed adaptation were canonical, because there were considerable differences in both cases. Watchmen signals early on that the original graphic novel is canon and the 2009 movie adaptation is irrelevant, in details ranging from the appearance of the classic characters to the cataclysmic events that concluded the tale.

Doctor Sleep, on the other hand, treats Kubrick’s movie as canon: in the first few minutes we are reminded that lovable old Dick Halloran died when Jack Torrance buried an axe in his stomach and the hideous Overlook Hotel is still standing, although long abandoned. In the book, Halloran lived and the hotel died.

This preference for the movie over the book might seem irksome to King, who has long maintained Kubrick missed the point of the book, or more precisely inverted its emotional and philosophical core to tell a different, bleaker, colder story. The Doctor Sleep novel, naturally, follows the plot of the book and not the movie.

Director Mike Flanagan really couldn’t have gone any other way, because The Shining is such a revered and carefully-studied movie. It would have simply baffled audiences if the new film had kicked off by telling them to forget about Kubrick’s classic. (Watchmen was able to go the other route in part because the movie adaptation wasn’t as popular, and partly because the people writing the TV show are not worried at all about baffling their audience.)

Following the plot of Kubrick’s movie also gives Doctor Sleep stronger visuals, a more focused plot, and a much punchier conclusion than the novel. Flanagan makes a very strong case that this is a story that really needed to end in the decaying halls of the Overlook Hotel.

The movie takes a long time to get there, and when it does, it gives King the last word on Kubrick by revising the tone and message of the entire saga to align more closely with the books. King wrote a harrowing allegory for addiction and emotional isolation that made it very clear, in the end, that Jack Torrance never lost his essential spark of humanity or his last shred of his love for his family, finding redemption in a climactic moment of sacrifice.

Kubrick’s Jack Torrance was a monster all along, losing his relatively brief struggle to be human in the haunted sprawl of the Overlook; as the infamous final shot of Kubrick’s film implies, Jack belonged in the hotel all along.

Flanagan wisely avoids trying to rewrite Kubrick’s ending, but the story of Jack’s now middle-aged psychic son Dan (Ewan McGregor) battling the same metaphorical and literal demons gives him a chance to add a new chapter to the Torrance family saga with an ending that lines up better with King’s ideas, which are delivered with all the subtlety of an axe chopping through a bathroom door. Readers of the Doctor Sleep book will find some bittersweet ironies in how Flanagan revised the second novel to give Stephen King the last word on Stanley Kubrick’s adaptation of the first.

Flanagan goes to great lengths to recreate Kubrick’s sets for the Overlook Hotel, and borrows a few of the low, wide-angle shots Kubrick employed to convey the perspective of a small child lost among adult horrors, but otherwise he doesn’t try to beat Kubrick at his own game.

Doctor Sleep is a much different story, a sprawling dark fantasy epic that covers decades of time and the entire breadth of the United States, rather than Kubrick’s claustrophobic tale of psychological horror. At times it trembles on the verge of becoming (gasp!) a superhero film, as psychic heroes and villains use their special powers to battle to the last. The title “Doctor Sleep” is a superhero-style alias given to Dan Torrance by one of the dying patients he tends in a hospice. Similar stories have been told with the X-Men. Superhero comics have been known to get as dark and grim as Doctor Sleep… like, for example, Watchmen.

Doctor Sleep could also be taken as a critique of the hot-young-vampire stories that were popular when King was writing the book. Think it would be cool to roam the land with a band of quirky immortals, living in a secret world and rocking cool fashion accessories? Think again.

Taken on its own merits, Flanagan’s movie is solid and strives to be more compatible with modern moviegoer tastes than Stanley Kubrick’s iconoclastic vision. Doctor Sleep is a competent big-budget fantasy film, not a work of deranged genius. Kubrick psychologically tortured Shelley Duvall to get the frightened-out-of-her-wits performance he wanted. Flanagan politely refused to push Jack Nicholson too hard to come out of retirement for a brief cameo.

There is, however, one intense and deeply unsettling sequence in Doctor Sleep that stacks up against any of The Shining’s horrors, and was reportedly almost as difficult for the actors to film as anything Kubrick lensed.

Doctor Sleep isn’t as twisted as a Kubrick film, but it doesn’t always play nice, and it occasionally achieves a level of hallucinatory sinister beauty that makes a strong visual impression in an era of CGI overload. McGregor is just about perfect as the grown Dan Torrance, Rebecca Ferguson delivers a memorably monstrous adversary, and the rest of the cast is excellent… except for those brief moments when characters from The Shining are onscreen and it doesn’t quite work, because nobody is doing anything wrong, but none of them are Jack Nicholson or Shelley Duvall.

Flanagan’s film is at its best when it does its own thing, the horrors of Dan Torrance’s childhood lurking beneath the surface as his exceptionally grueling midlife crisis unfolds. The story of Doctor Sleep could have been filmed with only vague references to The Shining, trusting the audience to remember the earlier film without quoting it directly, but that might have frustrated and disappointed an audience that expected to see the Overlook in all its dark glory again..

Unlike Stanley Kubrick, Mike Flanagan is not in the business of frustrating and disappointing his audience, or the authors of his source material. He delivered a good movie that, like its protagonist, lives in the long shadow of towering madness.