Rick and Morty season 4, episode 8, “The Vat of Acid Adventure” features a big twist to the episode that Rick Sanchez directly compares to the Christopher Nolan film The Prestige. Rick and Morty is no stranger to explaining its plot in terms of movie references, usually calling the movie out by name in the dialogue; this isn’t even the first time they’ve done a Nolan movie riff, with season 1, episode 2, “Lawnmower Dog” including a plotline based on Inception.

“The Vat of Acid Adventure” features Morty going through life using a remote control, which lets him save his progress, then reset if something happens that he didn’t want to. Morty uses it to take away all the consequences of his actions, until it starts to go wrong when he saves his life in the wrong moment.

Related: Rick & Morty Draw The Line At 9/11 Jokes

When it goes wrong, Morty confronts Rick, only to find a further wrinkle to the story that Rick compares to The Prestige. Rick insists he doesn’t do time travel (even though Rick and Morty did time travel in Rattlestar Ricklactica), so the device doesn’t work that way. Instead, it operates using parallel dimensions. Whenever he uses the remote, he’s actually jumping to an alternate dimension and killing the Morty in that dimension.

rick and morty the vat of acid adventure melting

Morty is horrified by this, realizing that he’s killing people in order to get what he wants, which parallels how Robert Angier (Hugh Jackman) pulled off his magic tricks in The Prestige. While it appears that he’s teleporting across a room, Angier is actually making duplicates of himself. There’s a problem with letting both duplicates live, so one of them has to be killed every time the trick is pulled off. Without knowing it, Morty has to do the same every time he gets a do-over in his life. Using the remote kills the Morty in the other universe, which terrifies him once he finds this out. He’s apparently killed many of them throughout the episode, not willing to tell Rick just how many times he’s done it.

There are some key differences from The Prestige, making this more than just a straight adaptation of that twist. Unlike Robert Angier, Morty has no idea that anyone is killed along the way. He’s also killing other versions of himself, not killing the original version of himself each time. It’s obviously based on the twist from The Prestige (not just because Rick calls it out), but different enough to not just feel like a ripoff of that plot. Without directly copying the twist, Rick and Morty season 4, episode 8 keeps the same horror of realizing that one of the main characters has killed possibly hundreds of people for their own selfish benefit.

Next: Does Solar Opposites Mean Rick & Morty Season 5 Will Take Even Longer?