Christopher Markus and Stephen McFeely’s Marvel journey began with Chris Evans’ Steve Rogers, whom the pair introduced in their script for 2011’s Captain America: The First Avenger. After the one-two punch of Avengers: Infinity War and Avengers: Endgame, most people would take a victory lap. Markus and McFeely staged an introspective Hall H panel at Comic-Con about the saga’s biggest challenges.

“Your first reaction is panic,” Markus said of the original assignment of writing two back-to-back Avengers movies. “If it’s bad, because you will be very embarrassed one year, and then you have to wait around and have to be embarrassed next year.”

The scripts worked out, and Endgame is now one of the biggest movies of all time. But it didn’t happen after the first draft. Or the second draft. Or the third draft. Or the shooting draft. As Markus reminded the audience, Marvel Studios works on its movies until it has to ship the finished product off to theaters. Plenty changed from beginning to end.

“There’s a lot of trial and error on these [movies],” McFeely said at the top of the panel. The duo admitted that while most of what we saw on screen in Infinity War and Endgame was created in rough form during the last few months of 2015, everything changed dramatically when the creative engines started firing. At one point in mid-2016, the duo filed drafts of the two scripts and ... it wasn’t cutting it.

“We flew back to Burbank from Atlanta, and it was an all-hands-on-deck moment. We were in trouble. The Thor storyline sucked rocks. [In Infinity War] he was fighting a serpent!”

“It was ... insufficient,” Markus added. “But Marvel knows how to foster the writing of the movie. They’re not a panic-based company. A lot of companies in Hollywood freak out after a first draft.”

Before diving into the story of Infinity War and Endgame, McFeely and Markus compiled a giant “manifesto” that listed every available character, object, and reference still in play in the MCU. The document offered some obvious plot choices (“Red Skull is clearly alive, and sucked into space by one of the infinity stones — let’s find a way to use him!”) but couldn’t solve some of the most cosmic challenges, like Thanos wielding unlimited power. What do you do with a villain like that?

According to McFeely, after weeks of frustration, Endgame executive producer Trinh Tran eventually complained, “What if we just killed him?!?” The lofty idea stuck.

“Killing him helps him as a character,” Markus said. “It cements the fact that he’s doing this for his stated purpose. He’s done! And that’s the most shattering thing for the Avengers.”

Markus and McFeely shrugged off the theoretical perils of time travel logic. They made a board (see above), they consulted physicists, and they stuck to the stated logic. Harder was whittling major character moments down to their simplest form, and trusting that the audience could follow along. The big problem was Smart Hulk.

“Smart Hulk was in the third act of Infinity War,” Markus revealed. “We wrote it, we shot it, and went on to shoot most of Endgame, and he achieved union with the Hulk while inside the Hulkbuster. He kicked Cull Obsidian’s ass. But it didn’t work. It was the wrong tone for the movie. But we had already shot Endgame, where he was already Smart Hulk.”

While the word “reshoots” regularly sets off alarms in the comic movie fandom, they were the solution to balancing Infinity War and Endgame.

“A big sequence where you see the union takes away from the attention of the story. A scene where Hulk eats a stack of pancakes [...] I’ve never seen that in a movie,” Markus said.