Elsa jilted at the altar. A massive avalanche. An army of snow monsters. A fateful prophecy. These were some of the elements of the original ending to 2013’s mega-hit Frozen, which is being revealed now for the first time.

Star Kristen Bell has previously told fans that ice queen Elsa was initially conceived as a more straightforward villain. But in this week’s Untold Stories issue of Entertainment Weekly, producer Peter Del Vecho details how Elsa’s characterization changed the film’s final act and how the team figured out an ending that helped make Frozen the most successful animated film of all time.

“With all the movies we were work on, eventually the film tells you what it needs to be and if you’re smart enough to listen to that, it leads you to a different direction than perhaps your preconceived notion,” Del Vecho begins. “So when we started off, Anna and Elsa were not sisters. They weren’t even royal. So Anna was not a princess. Elsa was a self-proclaimed Snow Queen, but she was a villain and pure evil — much more like the Hans Christian Andersen tale. We started out with an evil female villain and an innocent female heroine and the ending involved a big epic battle with snow monsters that Elsa had created as her army…”

Frozen went through many different iterations, but here are some common elements from some of the early drafts: Frozen was to open with a prophecy that “a ruler with a frozen heart will bring destruction to the kingdom of Arendelle.” We’re then introduced to Anna, our pure-hearted heroine, and Elsa, an unrelated evil Snow Queen. We learn Elsa is a scorned woman; she was stood up at the altar on her wedding day and froze her own heart so she would never love again. Both Elsa and the audience assume she’s the villain from the prophecy. Fast-forward to the final act: Elsa creates an army of snow monsters to attack our heroes while Kristoff has “a Han Solo moment” and comes to help Anna. To halt Elsa’s attacking army, the two-faced Prince Hans triggers a massive avalanche — not caring that the avalanche also puts Anna, Elsa and all of Arendelle in jeopardy. Anna realizes Elsa is their only hope, so she convinces her to use her powers to save the kingdom. The twist is that the prophecy from the beginning is actually not about Elsa, but about Hans — he’s the one with a metaphorical frozen heart because he’s an unfeeling sociopath. Elsa’s heart is then unfrozen allowing her to love again.

So, yes, originally Elsa was an evil supervillain because a guy dumped her (I guess she couldn’t … let it go!). Still, one could imagine Disney executing a fairly satisfying version of Frozen with this story — the redemption of Elsa and surprise third-act villainy of Hans gives the tale enough freshness to advance it beyond the classic Disney tropes. But for the Frozen team, this version wasn’t nearly good enough.

“The problem was that we felt like we had seen it before,” Del Vecho says. “It wasn’t satisfying. We had no emotional connection to Elsa — we didn’t care about her because she had spent the whole movie being the villain. We weren’t drawn in. The characters weren’t relatable.”

For more revelations from the past four decades of entertainment, visit ew.com/untoldstories.

At this point, director Chris Buck and director and writer Jennifer Lee started asking some key questions: Does Elsa have to be a villain? … And what if Elsa and Anna were sisters?

“Making them related led us to the idea of her living in fear of her powers,” Del Vecho continues. “What if she’s afraid of who she is? And afraid of hurting the ones she loves? Now we had a character in Anna who was all about love and Elsa who was all about fear. That led to making Elsa a much more dimensional sympathetic character, and instead of the traditional good vs. evil theme we had one that we felt was more relatable: Love vs. fear, and the premise of the movie became that love is stronger than fear.”

The team even had a “sister summit” at Disney where they called in employees to ask them about their family experiences for ideas on how to make Anna and Elsa’s relationship more relatable…

“One of the things Chris Buck had in most versions of the film was a moment where Anna’s heart was frozen and needed to be thawed. Chris said, ‘Does it always need to be true love’s kiss that solves that problem? Does it always have to be the man who comes in and rescues the female? Could it be something different?’ and that led to a different ending. Now that they’re related, Elsa had her own fear and it was Anna who would save the day instead of Elsa by rescuing her sister — and it would be that selfless act that thawed Elsa’s heart. Once we landed on that idea for an ending [Disney animation chief] Ed Catmull called in Jen Lee and said, ‘If you can make that ending pay off and if we can really feel it, I think we’ll have a successful film. And if you don’t … we’ll have nothing.’ … So that really put the pressure on her to make that work.”

Lee scripted an emotional new final act, but there was just one nagging problem left: During the finale action, the audience is supposed to undergo a progression of expectations and twists leading to the film’s unconventional conclusion. First, the viewer has to feel that Hans could be the hero, then they have to feel Kristof was the answer. It’s not until the last possible moment that we realize Anna saving Elsa is the solution. But how do you stage that in a visual way that makes sense?

To read more Untold Stories, pick up the new issue of Entertainment Weekly on stands Friday or right here. Don’t forget to subscribe for more exclusive interviews and photos, only in EW.

“She crafted a great ending, the problem was it was difficult to stage,” Del Vecho says. “We couldn’t figure out a way, logistically, to stage it. It’s easy in hindsight. But John Ripa, a story artist, had an idea. He couldn’t articulate it in a way that made sense, so he said, ‘Let me go off and storyboard this ending.’ He went off, boarded it and came back in, and what he showed was that Elsa’s emotions created a white out blizzard. That allowed us to isolate Hans and Elsa from Anna searching for Kristoff through the mist. That way we can reveal Kristoff just moments before we reveal Elsa to Anna, and it allowed the timing we needed. When he pitched that ending [Disney Chief Creative Officer] John Lasseter, the directors and the whole story team stood up and gave him a standing ovation. He helped crack visually how we were going to depict that ending.”