Preserving the secrets both Avengers: Infinity War and Avengers: Endgame wasn't just a job for fans who saw leaks of the film online, but also, a huge undertaking on the part of Marvel Studios. And now, in the just-released digital home video version of Endgame, Marvel bosses reveal exactly how they kept certain huge spoilers from leaking.

We already knew that several cast members didn't get complete scripts for Infinity War and Endgame, but now executive producer Trinh Tran and Marvel chief Kevin Feige have explained there were "code red" and "code blue" versions of these scripts. What does it mean? Well, it turns out the code blue scripts had fake versions of several character deaths where those characters…lived!

Marvel Studios’ Avengers: Endgame | Film Clip

On the just-released digital download of Avengers: Endgame for home video, there's a 6-minute video called "Avengers Script Security and the Secret Scenes of Infinity War and Endgame." Here, Marvel presents animated versions of the code blue fake scripts, written in such a way to disguise the fact various characters died in both films. Here's a breakdown of the shockingly hilarious scenes, but to get the full effect, you really should snag Endgame on streaming.

Warning: spoilers for both Endgame and fake alternate scenes in Endgame and Infinity War follow! Stop reading now if you haven't seen the movie, or don't want to be spoiled on the alternate plot twists of these bizzaro scenes.

“Loki Plays a Trick”

At the beginning of Infinity War, Loki tried to stab Thanos, but was then strangled to death. It was a shocking way to start the movie, but in the fake script, Loki uses a magic trick and flies away in a stolen space pod, waving at Thor. Thanos, bizarrely, sees no need to go after him. WHAT.

“Gamora Shakes It Off”

Everybody was devastated by Gamora's death in Infinity War, but in the fake version of the script, there was a scene called "Gamora Shakes It Off." Right after Gamora is thrown to her death, Thanos sees his daughter as a kind of absurd puppet on strings who hands him the Soul Stone. This then magically creates a pair of giant scissors that cut Gamora free of magic puppet strings. Boom! She's alive! She tells Thanos not to destroy half the universe, but he teleports away. Bottom line, in this version Gamora is alive!

“The Vision Crashes”

After Thanos pulls the Mind Stone out of Vision at the end of Infinity War, the character was totally dead. But, in the fake version of the script, right after Wanda is cradling Vision's lifeless body, his eyes light up again and he speaks in the cadence of the computer Jarvis, Tony Stark's A.I. which Vision merged with, back in Avengers: Age of Ultron. So, in this version, Vision lives, but kind of as weird computer version of himself.

“Thanos Keeps It Together”

At the beginning of Endgame, Thor, somewhat redundantly, cut off Thanos's head. But, in the fake version of the script, Thor's ax-hammer just bounces-off of Thanos's head. And then, Thanos simply takes a nap and Thor shrugs his shoulders and walks away. Considering that a 2014 version of Thanos ended-up returning later in the movie, it feels like that the impact of this silly alternate take isn't all that different?
