Before it became an acclaimed summer hit for USA, Mr. Robot was a feature film script buried inside the mind of Sam Esmail. “I wrote it with the intention of making it as an independent film,” the New Jersey-born writer/director told Yahoo TV before the show’s premiere in June. “The first season is really the first act of what the feature would have been — it’s ending where I’d want the first 30 pages of the film to end.”

Based on what we saw in the Sept. 2 season finale, that would have been a killer 30 pages. During the course of its 10-episode run, Mr. Robot continuously defied audience expectations, routinely shaking up what we knew — or thought we knew — about the main character, Elliot (Rami Malek), not to mention reality itself. Elliot’s already-fractured mind splintered further over the course of this hour as he sought to locate vanished Evil Corp executive Tyrell (Martin Wallstrom), even as their hack threatened to destabilize both that omnipresent corporation and the world’s economy.

Related: Vote for the TV Season’s Best Mystery!

Even though Mr. Robot ultimately went the television route, its creator made a point of folding numerous cinematic homages into the series, overtly and subtly referencing the work of such filmmakers as Stanley Kubrick, David Fincher, and Paul Thomas Anderson. Far from simply repurposing familiar big screen imagery, he recontextualized these allusions in a way that made them seem excitingly new. Eager-eyed film buffs probably noticed that the finale featured four particular sequences — including the scene that led the finale to be delayed a week from its original airdate — that echoed four specific films. Yahoo TV spoke with Esmail about these moments and the movies that inspired them. Warning: Spoilers for the finale follow.

The Suicide (2001: A Space Odyssey)

Esmail has openly acknowledged the influence of Stanley Kubrick on the show’s visual style, naming A Clockwork Orange and The Shining as particular points of reference. “I don’t know if we have done 2001 yet, but at some point I’ll borrow from it. Elliot will go into space,” he jokingly told Vulture in July.

Fortunately for Malek, Elliot didn’t have to don astronaut gear after all. The movie 2001 got its close-up (literally) in the finale’s most shocking — and controversial — moment, when Evil Corp executive James Plouffe (Richard Bekins) sat down to be grilled by a network news anchor about the company’s Elliot- and Tyrell-inflicted wounds. In a striking choice, we never see the anchor interrogating Plouffe; instead Esmail (who wrote and directed the finale) focuses on the unblinking eye of the camera filming the squirming man. It’s the same unblinking eye with which HAL 9000 dispassionately regards the two-man crew of Discovery, Dave Bowman (Kier Dullea) and Frank Poole (Gary Lockwood). “When I saw 2001, I remember being scared s–tless by HAL’s eye,” Esmail says. “Kubrick did something very smart: The camera didn’t move, it was completely static and staring at this eye. It almost made you believe it was staring back at you and it made HAL this menace.”

Although he deliberately framed the shot that way on set, Esmail says that it wasn’t until he got into the editing room that the deeper implications of the image were driven home in his mind. “I realized that we’d been breaking the fourth wall all season by having Elliot talk to his imaginary friend [via the narration]. And that shot of the camera has the effect of making us the imaginary friend that Elliot’s referring to that’s witnessing the carnage,” he says. “There was something about that that resonated with me. Using that imagery [from 2001], but having it say something completely different about the fourth wall in our show.”

That scene, of course, was filmed well before the real-life tragedy that befell two Virginia reporters on Aug. 26. In the wake of their murder, USA delayed the finale — originally scheduled to air that night — by a week, a choice that Esmail says he completely supports. “I hope people can watch the whole episode, and it’s not too insensitive or associated with the tragedy that happened.”

Elliot Gets a Black Eye (Fight Club)

The debate over whether Christian Slater’s Mr. Robot persona was Elliot’s version of Tyler Durden — the swaggering alter ego of the unnamed Narrator in David Fincher’s beloved 1999 headtrip Fight Club — raged all season long in forums ranging from The A.V. Club to Reddit. And Esmail made the conscious choice to wait until the finale to answer it. Previous episodes disclosed that Mr. Robot is the spitting image of Elliot’s father, who died years before. But in this last installment, the younger man figures out that he has the power to summon his ghostly guardian. Mr. Robot then turns around and schools Elliot, confirming that they are one and the same in the most painful way possible: picking a fight with a coffee shop patron and then letting Elliot take the punch.