[This story contains spoilers for Shazam! Fury of the Gods.]

If that final end-credits scene of Shazam! Fury of the Gods looked familiar, it was supposed to.

After a long battle against the daughters of Atlas — Hespera (Helen Mirren), Kalypso (Lucy Liu) and Anthea (Rachel Zegler)— the DC sequel ends with Billy Batson (Asher Angel/Zachary Levi) and the Shazam! family safely back together, rebuilding their home after it was destroyed in the final fight. They all have their powers restored, and Billy finally learns his true superhero name — it’s Shazam, obviously. And once credits roll on what is potentially Levi’s last outing as the superhero, there are two end-credits sequences.

The final end-credits scene calls back to the post-credit promises of the first film, which featured Doctor Sivana (Mark Strong) conspiring for revenge in his jail cell with an unlikely visitor — Mister Mind, a supervillain worm with a robotic voice who’s a major Shazam! foe from the comics.

This time around, the scene opens to Mister Mind and Sivana meeting once again. Two years have passed since the events of the first movie, and Sivana has been patiently waiting for the worm genius to help him break out of his cell, so he can enact his vengeance on Billy.

“Where in the hell have you been?” Sivana exclaims. “I’m stuck in a concrete box, surrounded by lunatics, waiting for a worm.” Mister Mind then explains that despite his genius and telepathic powers, slithering takes time. He doesn’t have legs or wings, which understandably makes traveling difficult.

While the sequel may have initially intended to focus on Mister Mind as the villain, co-writers Henry Gayden and Chris Morgan ultimately elected to go a different route by introducing the daughters of Atlas. In a recent interview with The Hollywood Reporter, Gayden revealed that the Fury of the Gods‘ final credits scene started out as a fun writing exercise.

“I wrote that truly on a lark,” the writer said. “No one asked me to write that. We’d done all these Mister Mind and Sivana drafts, and ultimately discarded them. And so randomly, I was like, well, it’s just so sad to lose them,” recalled Gayden. “So for fun, as a joke, I wrote that. Then months go by, and we’re getting into pre-production, and I was like, should we shoot this as a post-credits thing?”

Gayden recalls that former DC Films boss Walter Hamada “had forgotten about it, but was like, ‘This is the best thing you’ve ever written.’”

It turns out that there were even earlier drafts of the sequel script where Mister Mind and Sivana teamed up.

“There’s a scene where Sivana breaks out of prison without having to lift a finger because of Mister Mind’s help, which is one of my favorite scenes I’ve written,” the writer said. “There was stuff there that was great, but none of it really serviced a natural growth for Billy. It felt a little redundant. It felt like we were doing the last movie just on a bigger scale.”

Instead, he and Morgan wanted to focus on the question of family and what that would mean for Billy, who never had one before.

“The natural next chapter would be he’s going to hold on too tight because he’s terrified to lose that family,” said Gayden.

Instead, it made more sense to introduce villains woh themselves were family in the daughters of Atlas.

Shazam! Fury of the Gods comes at a time of change for DC. James Gunn and Shazam! producer Peter Safran were tapped last year to lead the studio’s film, TV and animation efforts, and Shazam! — like Henry Cavill’s Superman — was left off their upcoming slate. The franchise’s future is up in the air, though the soft box office coming in for Fury of the Gods hurts the likelihood of a sequel.

Still, if the co-writers were to continue the franchise, Gayden would like to potentially see Doctor Sivana and Mister Mind to eventually have their moment in the sun. “If we have Shazam! 3, it will be fun if we can bring them back,” Gayden said.

Added the writer: “But also, if we had Shazam! 3 and we go a different route with villains, I’ve always wanted the post-credits to continue to be Sivana and Mister Mind. I just thought it was the flavor of Shazam!, the fact that it kind of low-key makes fun of the tropes of movies. If the post-credit scene is always making fun of post-credit scenes, I think that could be really fun.”

Read More