Tonight, Riverdale‘s third season officially comes to an end with an episode titled “Chapter Fifty-Seven: Survive The Night.” And as you might imagine, things don’t go easily for the folks living in the Town With Pep. Yep, Archie (KJ Apa), Jughead (Cole Sprouse), Betty (Lili Reinhart) and Veronica (Camila Mendes) are forced to run for their lives on tonight’s episode… Though as it turns out, that wasn’t always the plan.

“We were breaking around [episode] four or five and we started talking in the room about doing a version of Most Dangerous Game which is, you know, our lead characters being hunted through the woods,” Riverdale showrunner Roberto Aguirre-Sacasa told Decider.

Once they started breaking down the story, though, the Riverdale writers realized that it was too early in the season, and had too many references to what would eventually happen in the finale. So Episode 5 became Episode 22.

“Six episodes out [from the finale], we took a pause, looked at all our stuff we had to answer, then made sure we were solving when those cliffhangers would be,” Aguirre-Sacasa continued.

In fact, this sort of finale is a big departure for the show. Season 1’s mystery, the death of teen Jason Blossom (Trevor Stines) was solved in the second to last episode. So was Season 2’s mystery, the identity of serial killer The Black Hood. Then the final episodes of the season have been left to wrap things up, focus in on the fallout of the season’s mystery, and set up a cliffhanger for the following year.

“You know, it’s funny, after the second year, the network basically said, ‘Your next-to-last episodes are always huge and then your finales are kind of quiet,’ Aguirre-Sacasa noted. “That was actually something [executive producer] Greg Berlanti had said, write your big stuff in the penultimate so now you get to actually do your character stuff. So basically, we were like, okay, let’s see if we can do both: Let’s see if we can go big in the finale and then still maintain the character stuff. So [those were] our marching orders from the very beginning of the season.”

As to who is hunting the so-called Core Four, and why? It ties into the overall season mystery of The Gargoyle King, a gigantic being seemingly made of sticks and bones that last episode was revealed to be *spoilers on* Jason Blossom. There are still a lot of questions about that particular reveal, particularly since Jason’s death kicked off the events of Riverdale right at the start of the first episode. But even that, according to Aguirre-Sacasa, is all part of the plan.

“This episode was definitely done as an homage to the pilot, really,” Aguirre-Sacasa said. “It’s really bringing the story full circle.”

The Riverdale Season 3 finale airs Wednesday at 8/7c on The CW. And check back with Decider right after the episode for a lot more with Aguirre-Sacasa.

Where to stream Riverdale