Ever since Warner Bros. and New Line announced Doctor Sleep, the big question on everyone’s mind has been the same: Exactly what version of The Shining is this a sequel to? Is this a straight adaptation of Stephen King’s 2013 follow-up novel? Is it a sequel to Stanley Kubrick’s iconic 1980 film adaptation? Can it be both when King and Kubrick had famously divided interpretations of the material? In what will likely come as a relief to horror fans, it seems the answer is yes.

Ahead of today’s Doctor Sleep trailer debut, I had the opportunity to join a group of journalists for a chat with writer/director Mike Flanagan and producer Trevor Macy to get some insight on the tricky project, and the filmmakers confirmed that Doctor Sleep is intended to serve as a sequel to both the novel and the film; a tricky balancing act that demanded precision adaptation work.

When asked which version of The Shining his film would be a sequel to, Flanagan seemed eager to answer the big question. “The answer’s really complicated,” he said. The answer to all of those questions for us has always been yes. It is an adaptation of the novel Doctor Sleep, which is Stephen King’s sequel to his novel, The Shining. But this also exists very much in the same cinematic universe that Kubrick established in his adaptation of The Shining.”

“Reconciling those three, at times very different, sources has been the most challenging and thrilling part of this creatively for us,” he continued. In order to pull it off, Flanagan and Macy worked with both King and the Kubrick estate, getting not just the blessing but “encouragement” from the author. “I went back to the book first and the big conversation that we had to have was about whether or not we could still do a faithful adaptation of the novel as King has laid it out while inhabiting the universe that Kubrick had created,” Flanagan explained. “And that was a conversation that we had to have with Stephen King to kick the whole thing off. And if that conversation hadn’t gone the way it went, we wouldn’t have done the film.

“As a lot of you know, I imagine all of you know, Stephen King’s opinions about the Kubrick adaptation are famous and complicated,” he continued. “And complicated to the point that if you’ve read the book, you know that he actively and intentionally ignored kind of everything that Kubrick had changed about his novel and kind of defiantly said, ‘Nope, this exists completely outside of the Kubrick universe.'”

No doubt that only made Flanagan and Macy’s jobs more challenging, but the filmmakers had the opportunity to vet their ideas with the man himself. “We had to go to King and explain how — and some of that amounts to very practical questions about certain characters who are alive in the novel The Shining who are not alive by the end of the film — how to deal with that,” Flanagan recalled. “And then, in particular, how to get into the vision of The Overlook that Kubrick had created. Our pitches to Stephen went over surprisingly well and we came out of the conversation with not only his blessing to do what we ended up doing, but his encouragement. This project has had for me the two most nerve-wracking moments of my entire career, and the first was sending the first draft of the script to Stephen King and that was utterly terrifying, but he thankfully really loved it.”

At the same time, Flanagan and Macy were able to work with the Kubrick estate and rely on Kubrick’s archived materials to make sure the on-screen return of the Overlook Hotel looked right. “They’re both really supportive,” Macy said. “From the Kubrick estate’s point of view, they have such a long relationship with Warner Brothers and they were generous with some of the original plans from The Overlook”

“We got to see his plans. Annotated by Kubrick. It’s so cool,” Flanagan interjected with excitement. In the new trailer, that attention to detail is evident. In fact, Flanagan composed a number of iconic shots from the ground up to faithfully recreate Kubrick’s vision. We see Danny on his tricycle, those horrifying Grady twins, the blood elevator, and the woman from Room 237 — only the blood elevator shot is pulled from the original film, Flanagan shot everything else with an obsessive eye for detail.

“I don’t want to spoil to what… we’ve been able to revisit from Kubrick’s world,” Flanagan said, teasing even more callbacks beyond what we see in the trailer. “But I can say that everything that we decided to use, our intention was always to detail, and reverence, and making sure that we were doing it properly, with the hope that even kind of the most rabid cinephiles might not be able to tell the difference with some of our frames and some of his.”

That said, if Flanagan and his team worked diligently to make sure Dan’s memories of the Overlook felt at home in Kubrick’s universe, they definitely weren’t trying to make a film that imitates Kubrick’s style. “That would be impossible,” Flanagan said bluntly (and correctly.) “As much as we talked about the balance between King and Kubrick,” he continued, “I said there’s no way that I could ever dare to kind of stand up to direct comparison with Stanley Kubrick. It’s ridiculous. At the same, at the end of the day, this is one of our movies.” That means that Flanagan and Macy will also bring their signature style to the equation, and while Doctor Sleep shares a universe with The Shining, they’re telling a whole new story.

“The story that we’re telling primarily is its own thing,” Flanagan said, “and it has everything to do with Dan and with Abra. In the same way that Dan the character is kind of permanently influenced and altered by the events of The Shining, so is our movie to an extent. But the divide is also just as great. He’s decades removed from those events, and so are we.” To play those roles, Flanagan recruited Ewan McGregor as the older, wiser Dan Torrance and scouted over 900 young actresses to play Abra before discovering newcomer Kyliegh Curran.

“So, while [The Shining] is definitely an element of the movie that we’re making,” he continued, “the heart and soul of the movie and the reason we wanted to make it at all was really about this new story between Dan and Abra. It’s unavoidably connected to that, but it is its own thing in a big way.”

That said, there’s no denying the omnipresent pressure of representing The Shining, one of the most beloved horror titles in history. “In a very real sense we’re standing on the shoulders of literary and cinematic giants,” Macy said. And they dedicated themselves to nailing down every single detail in the process of getting it right. Even the tiniest differences — should it be Room 217, as it is in the book, or Room 237 as it is in Kubrick’s film? — were the source of “robust arguements” during prep. “We went back and forth about four times in prep,” Macy said. Ultimately, as the trailer reveals, Room 237 won out, but that’s only one of countless Easter Eggs laid into a film that strives to strike a near impossible balance between two horror icons.

Of course, we already know Flanagan has a gift for “impossible” adaptations. In 2016, Flanagan delivered Gerald’s Game, the striking and emotionally resonant film adaptation of King’s novel, long considered “unfilmable” for the fact that pretty much the whole thing is the internal monologue of a woman handcuffed to a bed. Against the odds, Flanagan turned it into one of the best King adaptations to date. And it sounds like he may have done it again. Both King and the Kubrick estate were sent a cut of the film. How did it go? “Both went very well,” Flanagan said. “That was always the hope going in, was that if there was some universe in which Stephen King and the Stanley Kubrick estate could both love this movie, that is the dream. Threading that needle has been the source of every ulcer we’ve had the last two years.”

Asked if they faced any spooky on-set occurrences in line with the production of Kubrick’s film, Flanagan said that ultimately, “the scariest thing for us was making sure that we got the details correct.”