WARNING: This article contains spoilers for The Orville, season 3, episode 6, "Twice in a Lifetime."

Seth MacFarlane's The Orville has improved upon a controversial Geordi La Forge storyline from Star Trek: The Next Generation. The Family Guy creator's sci-fi comedy-drama is reminiscent of the Star Trek franchise's 1990s heyday, with its episodic storytelling and focus on an ensemble cast of characters. The Orville season 3, episode 6 "Twice in a Lifetime" puts the focus on helmsman Gordon Malloy (Scott Grimes,) who becomes stranded in 2015 following a temporal accident.

"Twice in a Lifetime" is a sequel to another Gordon-centric story, The Orville season 2, episode 11, "Lasting Impressions," in which the crew discovers a 21st-century time capsule. Inside the capsule is a smartphone belonging to Laura (Leighton Meester), whom Gordon becomes fascinated by. He creates a holographic simulation of her and develops romantic feelings for the simulation, remaking a TNG episode for Geordi La Forge (LeVar Burton.) "Twice in a Lifetime" takes Gordon and Geordi's story further, making significant improvements to the latter's dubious ethics.

Related: The Orville Just Succeeded Where Picard Season 2 Failed

In Star Trek: The Next Generation season 3, episode 6, "Booby Trap," Geordi creates a holographic simulation of Dr. Leah Brahms, a brilliant scientist who can help the Enterprise escape a mysterious power-draining force. Geordi reprogrammes the simulation of Brahms to be warmer and less robotic, leading to him falling in love with her. When the real Leah Brahms comes aboard the Enterprise in season 4, episode 16, "Galaxy's Child," she's horrified when she discovers Geordi's simulation but puts it aside to work alongside him. It's an uncritical approach to Geordi's abuse of Leah's image that proved controversial. The Orville flips this Star Trek story by bringing Gordon face to face with the real Laura and confronting the character with the gravity of his actions.

The Orville's Gordon And Laura Repeat TNG's Geordi and Leah Story (But Make It Better)

LeVar Burton as Geordi in Star Trek TNG

When Gordon is first stranded in the 21st century, he lays low, following the Union's laws when it comes to time travel. However, after years of waiting for the Orville to rescue him, he's long since moved on. Using the knowledge he acquires from Laura's smartphone, Gordon tracks her down and builds a romantic relationship, and starts a family with her. When Ed and Kelly finally arrive ten years too late to rescue him, they're horrified to discover what he's done. It's an even darker take on Star Trek's Holodeck romances that highlights the ethical problems at the heart of both Geordi and Gordon's respective decisions. Leah Brahms hasn't consented to become Geordi's holographic love interest in TNG, and Laura only falls in love with Gordon because he's become her perfect partner by meticulously researching her life via the smartphone and simulation.

Like Geordi's motivations for creating his idealized Leah Brahms hologram, Gordon's romantic pursuit of the real Laura in the 21st century is driven by loneliness. However, that loneliness leads to Gordon's increasing selfishness and criticism from his former shipmates. It's in stark contrast to the Enterprise crew's blind eye toward Geordi's problematic relationship with the Leah Brahms hologram. He largely escapes recriminations when he meets the real Leah, too. Gordon, on the other hand, provides a dark twist on this Star Trek story by becoming the villain of "Twice in a Lifetime." Eventually, the Orville crew is able to rescue the original Gordon from the right moment in history, averting this new timeline. On his return, Gordon is horrified to learn about the actions of his other self, which are also explicitly stated to be illegal. It's a far cry from Geordi's unapologetic defensiveness when confronted by the real Leah Brahms in Star Trek: The Next Generation, allowing The Orville to improve upon this controversial Geordi story.

More: The Orville Season 3 Just Introduced 1 Huge Missing Star Trek Element

The Orville: New Horizons releases new episodes Thursdays on Hulu.