The fates of Iron Man and Captain America in Avengers: Endgame were written well before Civil War hit theaters. Screenwriters Christopher Markus and Stephen McFeely have always said things were planned out way in advance, though not many thought it was four years in advance. The Endgame and Infinity War story arcs were tough to put together, so it makes sense that the stories were mapped out so far in advance. Marvel Studios boss Kevin Feige has said this many times when talking about the epic scope of both movies.

Marvel Studios is known for keeping secrets, but knowing that they had the death of Iron Man written in 2015 and nobody leaked it is pretty incredible. Robert Downey Jr. and Chris Evans both talked about leaving the Marvel Cinematic Universe when it felt right, and they chose perfect times. But it wasn't an easy thing to map out. Stephen McFeely explains.

RELATED: New Avengers: Endgame Theory Suggests Doctor Strange Lied and Deliberately Let Tony Die
"It's such a leap faith, right? We'd only had one movie as a foursome under our belt (when hired for Infinity War and Endgame). We got the job, thought about it all throughout the shooting of Civil War. And then the last four months of 2015, we cracked both those (Avengers) movies. So, Tony's death and Cap's dance were on three-by-five cards in September of 2015."

Avengers: Endgame is a massive movie and so is Infinity War. Christopher Markus and Stephen McFeely had their hands full when they were prepping the stories. "Kevin Feige, the head of Marvel, had hired me, Chris, and [directors] Joe and Anthony Russo simply based on The Winter Soldier, to do both the Avengers movies," says McFeely. That's also a pretty big gamble by Kevin Feige, though everything worked out far better than anyone ever imagined at that point.

Apparently even making Civil War was tough on the screenwriters. "We nearly had a nervous breakdown," reveals Christopher Markus. That's the movie that really took the team-up to the next level and cemented the creative team that would ultimately shape the Marvel Cinematic Universe's future. It sounds daunting, but Kevin Feige knows how to pick his teams and has a pretty much unblemished reputation, thanks to the faith that he puts in his collaborators.

Avengers: Endgame took the MCU and shook up everything fans thought they knew about everything. Risks were taken and rewarded as most fans love what they were able to pull off. However, it seems that the real talent is keeping secrets around Marvel Studios since the Captain America and Iron Man story arcs were written on a board back in 2015. It will be interesting to see if the Russo Brothers, along with Christopher Markus and Stephen McFeely end up sticking around to make some more movies together with Marvel Studios. The interview with McFeely and Markus was originally conducted by Vanity Fair.