Loki writer Michael Waldron recently revealed how a plot point in Avengers: Endgame influenced the creation of the Disney+ series.

In an interview with The Playlist, Waldron explained how he was in a parking garage when producer Kevin Wright called to tell him what happened in Endgame before its release.

Read more: Natalie Holt makes history as first woman to score live-action ‘Star Wars’ project

“I was like, 'How is Loki alive in the show?'” he recalls. “How was there even a show? And so he called me, and he was like, 'So, Endgame is a time heist.' And I was like, 'Oh, my God.' And it’s perfect.

“What that meant, what kind of adventure he went on, even what the [Time Variance Authority] was, as an entity within the MCU and how we would adapt that from the comics, were all up for grabs,” he adds. “And so that’s when I came in and kind of pitched this Blade Runner-esque story about Loki being pulled in by the TVA to catch a variant of himself.”

Waldron shared the information while promoting his latest project, Doctor Strange In The Multiverse Of MadnessThe new film arrives May 4.