It's time to return to the Overlook Hotel, as the ending of The Shining sequel Doctor Sleep finds Dan Torrance, now a grown man, back in the decaying remains of the building that almost killed him as a child. Directed by Mike Flanagan and based on Stephen King's novel of the same name, Doctor Sleep expands the mythology of The Shining and brings Dan Torrance's character arc to a poignant close.

Several decades after the events of The Shining, Dan has managed eight years of sobriety following a struggle with alcohol abuse, and works as an orderly at a hospice, using his powers to help soothe patients as they die. His peaceful life is interrupted when his psychic penpal, a teenager called Abra Stone, is targeted by a tribe of demonic beings called the True Knot, who live for centuries by torturing children with the shining and consuming their "steam" - the essence of their magical powers. After successfully killing most of the True Knot, Dan and Abra are left to face their leader, Rose the Hat, who is as hungry for vengeance as she is for Abra's steam.

Related: Kubrick Made A Shorter Version Of The Shining (& It's Better)

Knowing that the Overlook Hotel also feeds on steam, Dan makes the dangerous gamble of bringing Abra to the haunted old hotel to lay a trap for Rose. He unleashes the hotel's ghosts, who he has locked up one by one over the years, and the starving spooks descend on Rose and consume her until there's nothing left - though not before she manages to give Dan a lethal wound by nicking the femoral artery in his leg. Having eaten Rose, the ghosts turn their attention to Dan and the hotel takes possession of him. He starts chasing Abra with an axe (just like his father did all those years ago), but manages to fight back for long enough to let her escape - and to put an end to the Overlook once and for all.

Why Danny Went Mad (& Why He Had To Die)

Doctor Sleep - Ghosts Attack Dan

The Overlook Hotel is essentially a psychic vampire, absorbing the ghosts of the people who die inside it, and turning them into agents of its own hunger. The ghosts of the hotel were drawn to young Danny because of the shining, and continued to follow him even after he left. Jack Torrance also had the shining, which is why he was able to see the ghosts of the Overlook. Rose the Hat tells Dan that the steam becomes corrupted and tainted as children turn into adults, and it's this corruption that allowed the Overlook to effectively take possession of Jack and send him to murder his family. The hotel wanted young Danny to die inside its grounds so that it could feed on him, and after he unleashes the ghosts from their boxes, they start to feed on him as well.

Unlike Jack, Dan's descent into apparent madness happens very rapidly, and when he manages to corner Abra in Room 237 she realizes that the hotel is wearing his face like a mask. However, Dan had planned for this eventuality from the start, by rigging the Overlook's boiler to explode. Abra tells this possessed Dan about this, and the hotel's desperation to preserve itself outweighs the need to consume Abra, giving her a chance to escape. Dan (who was really dead from the moment Rose the Hat cut his leg and caused him to start bleeding out) uses his last vestiges of energy ensure the place that killed his father is destroyed, and dies at peace in the burning hotel, finally reunited with his mother.

How Danny Can Still Talk To Abra

Doctor Sleep Dan and Abra

One of the ways in which Doctor Sleep brings Dan Torrance's story full circle is by having him play the same role in Abra's life that Dick Hallorann once played in his. This is highlighted by the parallel of young Danny sitting on a bench with Hallorann's ghost at the start of the movie, and Dan later sharing a bench with Abra the first time they meet in real life. The scene in which young Danny talks to Hallorann on the bench, only for his mother to arrive and see Danny sitting on the bench alone, is also mirrored when Abra is talking to Danny in her room at the end of Doctor Sleep and her mother enters and sees Abra alone.

Related: Stephen King’s Shining TV Series Remake Isn’t As Bad As You Think

Danny speaking to Abra in her room doesn't mean that he's stuck haunting her or cannot move on. As Dick Hallorann explained when his ghost visited Danny for the last time as an adult, time works differently in the afterlife, and it's likely that Dan will move on just like Hallorann did - except for those moments when Abra needs him.

What The Women In The Bath Means (& Why Abra Must Face Her)

The Shining Woman in Bathtub

One ghost from The Shining who makes a big comeback in Doctor Sleep is Lorraine Massey, the spirit inhabiting the bathtub of Room 237. Once a seductress who ultimately committed suicide in the bathtub, Lorraine tried to strangle young Danny in The Shining and appeared as a young woman to Jack Torrance, who kissed her until he saw her reflection in the mirror and realized that he was actually kissing a rotting old woman. Lorraine is one of the strongest ghosts in the Overlook, which is why Room 237 has such a sinister energy, and she's also the first ghost to follow Danny away from the hotel. With Dick Hallorann's help he is able to lock her away in a box in his mind, but during the final fight with Rose the Hat she is released along with the rest of the ghosts.

The Overlook may have been destroyed, but its ghosts weren't, and just like they did with Danny they follow Abra in the hope of feeding on her. However, Abra is well-equipped to handle a few ghosts, and the movie ends with her entering the bathroom without fear. Like the shine vampires, Lorraine Massey's ghost represents the way in which adults feed on children and rob them of their innocence, but thanks to Danny, Abra is prepared to deal with her. She might lock Mrs. Massey up into a box like Danny did, but given her power levels it's more likely that she'll just destroy the ghost outright.

What Doctor Sleep's Ending Really Means

Dan Torrance In The Shining

Speaking to CinemaBlend, about Dan's alcoholism in Doctor Sleep, McGregor said, "Mike was very clear that The Shining was a novel that was written about alcoholism and addiction, and Doctor Sleep is a novel that was written about recovery." Part of that recovery, for Dan, is journeying back to the start of where his alcoholism began, by returning to the Overlook Hotel and confronting the ghost of his father. During one of his AA meetings, Dan admits that since his father died when he was so young, the only way he could remember and feel close to him was by drinking and lashing out in anger to same way his father did. However, Jack Torrance also managed to get sober before his fateful journey to the Overlook Hotel, and Dan finds a healthier way to get to know his father by making that same journey to sobriety.

As in The Shining, the Overlook Hotel is a metaphor for addiction. Jack Torrance got sober after accidentally breaking young Danny's arm while drunk, but the Overlook once again seduced him down a path towards hurting his loved ones. A key turning point in The Shining is when Lloyd the bartender pours Jack a drink, effectively acting like the whispering voice of addiction. For Dan, who became an alcoholic in imitation of his father, it makes sense that his Lloyd would be Jack Torrance. Unlike his father, however, Dan is able to use the tools of recovery to resist the temptation to fall back into old patterns, and his burning down the Overlook with himself inside is a way of ending that cycle of addiction - for Abra's sake.

More: Doctor Sleep Review: The Shining Gets a Worthy Sequel