Spoilers ahead for Avengers: Infinity War and Ant-Man and the Wasp.

Petyon Reed had a tough task ahead of him with Ant-Man and the Wasp since he had to be the first MCU movie to follow the events of Avengers: Infinity War. He also didn’t have the benefit of Captain Marvel, which takes place decades before Infinity War. Additionally, Infinity War is a far different movie in terms of tone and scale than Ant-Man and the Wasp, and yet they inhabit the same universe and Ant-Man and the Wasp was subject to Thanos’ devastating snap.

At a Q&A after Collider’s IMAX screening of Ant-Man and the Wasp, Steve Weintraub asked how early Reed knew about the ending of Infinity War and how he planned to execute it in his movie:

“I knew really early on. When we started the writing process, I knew. What I didn’t know was how it was going to factor into our movie. So the tricky thing about that was knowing everyone having seen Infinity War was going to come into Ant-Man and the Wasp and be looking for clues. ‘How’s this fit into the timeline?’ And we don’t give any clues for some time. We give clues that it’s after Civil War. And we started talking about having actors walk in front of monitors with events in the background of what’s going on, and that just seemed lazy to us and we’d seen that before and we wanted do something different and more striking. And in our outlining process, we kicked that problem down the road a little bit. And then we did this thing in the lead up to the end credits what we jokingly called ‘The Parade of Resolutions’. And the idea was to have these extremely neat resolutions one after the other. Scott’s back, he’s made it off house arrest, he’s reunited with Cassie, the X-Con guys get the Garribidean Project so their company is going to be saved, Hank has saved Janet so he’s grown the house on some tropical island, and Scott and Hope are on a date with Cassie at the drive-in where they’re shrunken down, and everything’s great! And Ant-Man and the Wasp ends as it’s supposed to end. Everything is really colorful with the credits sequence at the end, and then, oh, what’s this? Some time has progressed where we throw a lot of stuff at the audience—Janet’s in street clothes, and there’s Luis’ van, and they’re sending Scott in for some Quantum healing particles and they mention Ghost so you’re spinning like, ‘Oh, they’re progressing the story.’ We wanted to try and catch the audience as off-guard as possible, so when he’s left there and you come back and see the three of them dusted it’s just this gut-punch. That felt like the absolute Ant-Man way to deal with it. Because you can’t do what Infinity War did it because it’s the most dramatic swing imaginable in a movie, and in a Marvel movie. And so we wanted to do it our way.”

Reed then talked about how his screenwriting team paired up with the filmmakers behind Infinity War and Avengers: Endgame for how they should depict the scene since they knew it would now come at the end of Ant-Man and the Wasp:

“We all talked—it was Paul, Chris McKenna and Eric Summers—and we sat down with the Russo Brothers and the screenwriters Marcus and McFeely about the timeline, but there was still a discussion with our movie in terms of who was going to get dusted. Who was going to be on the parking deck. At one point we talked about, ‘Is Bill Foster up there? Is Eva Starr up there? Do they all dust out?’ but then it became a percentages thing. It’s supposed to be 50%, so it can’t be, ‘Really? All of them went? That seems different than what I saw in Infinity War?’ There were certain things that we knew. Marcus and McFeely pitched an idea for the scene and we all kind of built off that idea. It involved Scott and it involved Luis’ van and a new Quantum Tunnel 2.0, but it was very collaborative thing. There was a lot of back and forth, because I’ve talked about this on the first Ant-Man, I was editing and I had the Russo Brothers and Macrus and McFeely come in the editing room, and I showed them, I think it was the sequence where Scott breaks into Hank’s house and does the whole thing with the safe and steals the suit and showed them a bunch of other stuff, I think including the first Luis montage, but to just give them an idea of the tone of Ant-Man and how Paul was playing Scott Lang so they could write for him for Civil War. So there is a lot of back and forth, which is really fun. This one was tricky because with the ending of Infinity War, there’s not a bigger dramatic swing you can take with a movie. We knew if we introduced that concept too early in Ant-Man and the Wasp, because we talked about that early on, and if you introduce it too early, then that’s all anyone cares about because it threatens to dramatically take over your story. There was a lot of discussion about—you saw the scene with the fan and the dust swirling on the parking deck—but like location-wise, where is it going to be? Who’s it going to be? That kind of stuff. Once we landed on the idea and it made sense for both movies, or for all three movies, that was a pretty exciting day. I’ll call it a ‘breakthrough’, I guess.”

I honestly think Reed and his many collaborators all came to the best conclusion possible when it comes to executing the snap. It really is a gut-punch moment, but in a different way from Infinity War because Ant-Man and the Wasp is such a light, upbeat movie. It’s a film that couldn’t possibly handle the snap anywhere but the end, and yet I’ve come around to the necessity of that scene, not just for the overall MCU, but to remind us of the connective tissue of these movies. It had to be addressed, and as you can see, it was no easy task to get there.

Look for more from our exclusive interview with Peyton Reed soon