Pretty Little Liars type TV Show network Freeform genre Drama

On Tuesday, Pretty Little Liars‘ opening scene was unlike anything the show had done before: The viewer was taken inside Spencer’s mind as she watched a young girl — played by Maddie Ziegler — dance around a creepy room in what appeared to be Charles’ dollhouse.

It certainly wasn’t what fans of the show were used to, but it did get them talking. And as it turns out, it’s actually been in the works since last season.

“Maddie is represented by the same agency that I am,” said executive producer Oliver Goldstick, who co-wrote the episode with Maya Goldsmith. “They called me last year toward the end of the season and said, ‘Can you put Maddie in it? Maddie’s a huge fan of the show.'”

Of course, Goldstick recognized Zieger from Sia’s “Chandelier” music video, but unfortunately, the show had just finished a dance sequence with Shay Mitchell and Ashley Benson. “I didn’t believe [that] with three episodes left in the season [that] I could ask for another dance sequence without them saying, ‘Oliver, this is not Glee. You can’t keep doing this to us,'” he said with a laugh.

But with the show already having been picked up for another season — or two, technically — Goldstick told Maddie’s people to be patient. And as soon as he realized that he could organically incorporate her into the story, he reached out.

“After the dollhouse in the last finale I thought, okay, we’re already in a place where we don’t know who was in that bunker besides our girls, so the idea was we would find a way to create, at least if not a legitimate sequence, a fantasy sequence,” Goldstick said.

So once Maddie was in, the show reached out to So You Think You Can Dance star Travis Wall for the choreography. As far as direction went, Goldstick told Wall that he didn’t “want to make it overly Exorcist.” So to give him a better sense of what he was looking for, Goldstick presented wall with a piece of music, “Syrinx,” a flute solo by Claude Debussy. “It’s very gentle and delicate. It’s not horror music,” he said. “I said, ‘I want you to listen to this because I want to juxtapose the sweetness of this music with a childhood that’s gone dark. This could be one of these Allison girls that ‘A’ has possibly kidnapped and kept down here.'”

Wall immediately understood the tone. And thankfully, he knew Ziegler well enough that they could come up with a sequence despite the fact that their busy schedules only gave them six hours of rehearsal time.

In the end, Ziegler danced to “Syrinx,” but the show’s composer, Michael Suby, then built on the music to make the final product something that would work well within the world of the show.

As for the look of the scene, Goldstick was worried that Radley had started to feel old for fans of the show. “We’ve done every room in that hospital; there’s nothing that’s fresh about Radley,” he said. So for inspiration, he turned to Cane Hill Asylum, an abandoned mental hospital in Coulsdon, England that he found on the Internet. “For years it was empty and people would go there and hang out and they would take photographs,” Goldstick said. “I saw those tubs. They were filled with blackish water. So I printed it out and took it to our production designer and said, ‘This is what I want it to be.'”

Put it all together, and you get one of the creepiest sequences in Pretty Little Liars history.