Warning: the following post contains spoilers for the end of Avengers: Infinity War and Ant-Man and the Wasp.

When Marvel’s Ant-Man and the Wasp hit theaters on July 6th, one big question needed to be answered: how would it tie into Avengers: Infinity War? That movie ended with Thanos (Josh Brolin) killing half the universe’s population — including half its superheroes. Black Panther (Chadwick Boseman), Doctor Strange (Benedict Cumberbatch), Spider-Man (Tom Holland), and many others were reduced to ash, making it unclear how Marvel’s latest movie, released barely a month later, could follow the blockbuster without addressing its massive loss of life.

Marvel handled it by designing Ant-Man and the Wasp as a prequel, with the bulk of its running time happening before Infinity War. But it synced up with Infinity War during the legendary Marvel closing-credits scenes. A mid-credits scene featured Scott Lang (Paul Rudd) diving into the quantum realm, assisted by Hank Pym (Michael Douglas), Janet Van Dyne (Michelle Pfeiffer), and their daughter Hope (Evangeline Lilly). Once Scott is in the microscopic universe, however, his communicator suddenly goes quiet — and the audience learns that everyone else in the scene has been turned to ash, struck down by Thanos’ plan.

It’s a gut-punch following a film that is otherwise a lighthearted, fun action romp. The movie does end on a lighter note — first with the end-credits scene, which renews a running gag about a super-sized ant subbing in for Scott by playing his drums in his house, and then with the ending title cards. The first one reads “Ant-Man and the Wasp will return!” until the exclamation point turns to ash and is replaced with a teasing question mark. During a recent interview with director Peyton Reed about coordinating with the rest of the Marvel Cinematic Universe and avoiding superhero fatigue, I asked him about the end credits scenes, but Disney asked that his spoiler-centric comments be embargoed until two weeks after the film’s release. Below is my conversation with Reed about how the end credits scenes came about, what audiences should take away from them, and how he was poking a bit of fun at Marvel fans’ own obsessive love of the franchise.

The reveal that Hope, Janet, and Hank have been turned to ash is a real downer for an upbeat movie. Where did that idea come from? Why did you decide that was the right way to tie your movie into Infinity War?

We obviously always knew we were following Infinity War, and we always knew how Infinity War ended. What we did not know was really if, or how, our movie was going to deal with those events. In the writing process, we went down a couple of avenues. It was like, “Well, we know we’re really dealing with the fallout of Civil War. We’re two years after the fact, and Scott’s got three days left on house arrest.” So that was the fertile ground for our characters. But we know people are going to come into this movie looking for clues: “What’s going on with Infinity War?”

“We know people are going to come into this movie looking for clues.”

Once they realize what our timeline is, and that we’re not really giving them any clues about that, they submit to the story as they’re watching the movie. But we talked a lot about how we were going to seed it in. As the movie progresses, were we going to start to see news reports, or things in the background that indicated what was going on in the world at large? It seems like we’ve seen that before in other movies, and it didn’t strike us as that interesting. If we show too much of it early on, it felt like it could threaten to just completely overtake our story, because that’s such a bold, dramatic move at the end of Infinity War.

So once we landed on the structure that is in the final movie, it just felt right. It felt like the Ant-Man and Wasp way of dealing with that event. I think actually [Christopher] Markus and [Stephen] McFeely, the writers of the Captain America movies and the last few Avengers movies, came up with the kernel of an idea of how we could deal with it. Then we all took that idea and ran with it, and wrote the scene that’s in the final movie.

Part of that [process] was who was involved in that scene. Do you also have Luis (Michael Peña) there? Do you have Bill Foster (Laurence Fishburne) and Ava (Hannah John-Kamen)? There’s a very specific percentage [of people that should die] that’s set up in Infinity War, so that helped dictate who was there, but we always liked the idea of our movie having a pretty tidy ending, and then blowing it out of the water with that credit sequence.

Were you worried about it being too dark? Was that why you went back to comedy with the giant ant?

I was never worried about tone, but it was about figuring out the tone and making sure that event — you’re not going to outdo the gut-punch Infinity War gave audiences, and we didn’t want to. We wanted to deal with that series of events in the way our movies would deal with them. That was really the guiding light, tonally. And the final tease with the ant kind of felt like, “Okay, well, it’s only a breadcrumb, but it’s a slight glimmer of hope. Take that with you.”

Was the question-mark tease just a joke, or should audiences really be concerned? Obfuscate as you will.

At first, it really struck us as funny. I mean, there were always the James Bond movies [that would tease the next film]. “James Bond will return in For Your Eyes Only.” So we wanted to do a riff on that comedically, and really play into the mystery. It struck me as funny in the body of our movie, and then it also struck me as funny in the larger MCU sense of audience members hanging on every thread of any piece of information, as they should, in these movies. “What’s going to happen? What’s going to happen to my heroes?” And so it was just a fun thing to play with the audience with.

So the gag is, you’re riffing on the audiences being obsessed — and then giving them absolutely nothing.

Yeah. Exactly.