For once, getting canceled is a good thing.

With Mona and Gary’s help in the real world, the Legends regain their memories.

In other words, Guggenheim was handed a fun yet very difficult episode for his first go at directing.

Legends of Tomorrow, Marc Guggenheim

Credit: Jack Rowand/The CW; Inset: VALERIE MACON/AFP via Getty Images

Below, he takes EW inside the hour’s Easter Eggs, musical moments, and more.

How much fun did you have going through your repertoire and adding all of those in?

MARC GUGGENHEIM:You know whats funny?

DC’S LEGENDS OF TOMORROW

Jack Rowand/The CW

A lot of them were already in the script.

That was my ad-lib.

I have to say that was a really fun day on set.

DC’S LEGENDS OF TOMORROW

Jack Rowand/The CW

If you cant laugh at yourself, then youre not really trying.

This episode has a lot of musical elements, which are a beast to handle on their own.

How did you approach those?

Well, first of all, heres the thing: The cast is incredible.

I mean, they can sing.

They come into the recording, theyre like, What key is this in?

and they know all the technical terms.

You know, Matt [Ryan] and Olivia [Swann] were so game.

Its not easy stuff.

But everyone just came in and got it.

Im lucky insofar as Ive had experience onEli Stonedoing pre-record sessions and singing on camera.

But I gotta give credit to [co-showrunner/writer] Grainne Godfree.

To add another complicated aspect to this episode, you have two versions of Zari.

How difficult was it to pull that off?

Well, you know what?

Its hour 14, were like trying to get this done.

Like cmon, you dont give a first-time director this on their very first day."

I will say, I was learning on the job how to use that piece of equipment.

This episode is funny and goofy, but theres also this sadness to it.

Did you have For the Man Who Has Everything on your mind when you read the script?

How did you approach those emotional moments where the characters are confronting this sadness?

In some cases, theyre tempted.

In other cases, theyre trying to get the hell out of dodge.

The biggest sort of challenge for me was making sure each scene was tracking emotionally.

Im like, You are coming from this scene.

I was very afraid of it feeling emotionally schizophrenic.

How did you go about creating that dystopian Loom-World visually?

I feel like thats definitely going to hit viewers a little bit differently now considering where were at.

There were so many different elements to it.

Obviously, costuming plays a huge role.

So any one of those jobs wouldve been enough for any art department.

That script-writing machine was constructed by the props and art department working in concert together.

And it really works.

Theres no visual effect there.

It is actually typing itself.

That would definitely be helpful.

I noticed that the final shot of the episode mirrors the final shot of the season 4 finale.

Was that in the script?

No, it wasnt.

But I have to say that I wasn’t intentionally homaging that shot.

Id love to think I was that smart.

I probably was, on some subliminal level, influenced by last seasons finale.

This interview has been edited for length and clarity.

DC’s Legends of Tomorrowairs Tuesdays at 9 p.m. on The CW.