Warning: contains SPOILERS for Episode 7 of Star Trek: Discovery!

-

Ain't no party like a Star Trek: Discovery party 'cause a Star Trek: Discovery party has time loops. It also has an uninvited guest: Harcourt Fenton Mudd (Rainn Wilson), the rouge charlatan who was last seen left behind in a Klingon prison ship in episode 5 'Choose Your Pain'. Harry Mudd didn't forget this slight by Captain Lorca (Jason Isaacs), who left him for dead, and not only does he not forgive Lorca, Mudd concocted an ingenious scheme to exact his revenge. With Episode 7 'Magic to Make the Sanest Man Go Mad', Star Trek: Discovery succeeds in tackling the classic Trek trope of time travel.

Like the Enterprise has many times before (or rather, will many times to come), the Discovery finds itself caught in a causality time loop engineered by Mudd. Well-aware that the Discovery is the greatest weapon Starfleet has against the Klingons and is turning the tide of the war in the Federation's favor, Mudd cut a deal with the Klingons to steal the Discovery - and its revolutionary spore displacement drive - and sell it to the enemy empire. How he goes about his plot could make a man go mad, so we'll explain Mudd's machinations.

What started out with the crew of the Discovery having an epic party turned into an epic nightmare. The ship crossed paths with an injured gormagander, which is a kind of space whale that feeds on solar winds. After beaming it on board and detecting strange energy readings, an armored Harry Mudd marched out of the gormagander's mouth and began opening fire, killing several crew members. He then unmasked himself to a shocked Captain Lorca before the ship exploded. Then, like in Groundhog Day, everything reset back to the same party when everything strange began happening 30 minutes before. Soon, Lieutenant Paul Stamets (Anthony Rapp) reached Michael Burnham (Sonequa Martin-Green) and dropped his discovery on her: Harry Mudd had pulled the Discovery out of the time stream and trapped it in a time loop.

Stamets was able to figure out what was happening because he somehow exists outside of the time loop and is able to retain all of his memories after each reset. Since injecting himself with Tardigrade DNA - Tardigrades are multi-dimensional creatures - and continually interfacing with the Mycelial spore network, Stamets has tapped into unknown levels of space-time. Stamets' more upbeat personality is just one side effect; being immune to Mudd's time displacement is another. Stamets is able to convince Burnham of what's happening and she is subsequently able to enlist Lieutenant Ash Tyler (Shazad Latif) after convincing him. Still, it took multiple tries to stop Mudd, just as Mudd took even more do-overs to get his scheme underway.

As Mudd tells it to Lorca in one of the time loops, he invaded Discovery over 53 times to learn how to take over the ship's many functions. However, Mudd couldn't figure out the missing component that makes the spore displacement drive work - which is Stamets himself. Mudd's ire was reserved for Lorca, however, whom he despises for leaving him behind on that Klingon bird-of-prey. In an amusing montage, Mudd revealed he murdered Lorca multiple times in various ways. Mudd also accessed Lorca's private arsenal of weapons, finding dark matter spheres he used as weapons to kill Tyler (and Burnham later used to kill herself at one point to force time to reset).

How Mudd was able to perform his time travel magic was revealed when Burnham realized Mudd wore a time crystal on his wrist and hid a larger time crystal inside his ship, which he then hid inside the gormagander. (It's unknown whether Mudd's time crystal is similar to the Bajoran Orb of Time seen in Star Trek: Deep Space Nine.) Tyler later offered the intel that Mudd once shared when they were cell mates in the Klingon prison: Mudd bragged about once using similar technology to break into a Betazoid bank. With his time loop crystal, Mudd was able to remove Discovery from the time stream, but only for 30 minutes at a time. After 30 minutes, Discovery would explode, but the time loop would reset, allowing Mudd (who retains all his memories) to start all over again and keep trying new things until he learned everything he needed to learn - which included taking over all of Discovery's computer functions and installing himself as Captain Harry Mudd.

Mudd, however, couldn't have known that Stamets could also retain his memories and confided in Burnham. Burnham's plan to stop Mudd involved adding herself to Mudd's deal with the Klingons; as the person who killed T'Kuvma, the Klingon Messiah, the empire would want her head and would pay as much if not more for her than they would for the Discovery. Unable to say no to doubling his profits, Mudd agreed, but Burnham killed herself. This forced Mudd to continue with rather than end the time loops after he'd captured all of the Discovery, including the secret that Stamets was the missing component of the spore drive. But Burnham was simply buying time, not just to clue in Lorca and the rest of the crew on Mudd's plan, but to access the computer's records and learn vital information about Mudd.

Paul Stamets in Star Trek Discovery

It turns out Mudd has been on the run from his "beloved" wife Stella Grimes and her billionaire robber-baron father after skipping out on their marriage. Once they turned the tables on Mudd, they revealed they made contact with the Grimes and that they, not the Klingons, were the comes coming to meet Discovery once Mudd restored the ship back to the normal timeline. Burnham and the crew captured Mudd and turned him over to his in-laws, which seems like a slap on the wrist compared to the murder and mayhem Mudd achieved, even if it turned out not to be permanent.

While an engaging, mind-bending time travel adventure very much in keeping with classic Star Trek, the episode's biggest flaw lies in its depiction of the Klingons themselves. Though the Klingons remained entirely off-screen, Discovery's conceit that this proud and deadly warrior race would be open to - and have the financial means for - a wild scheme with a human con man to buy Starfleet's most advanced starship and the technology it contains is a tough pill to swallow for Star Trek fans. This plot is more like something the Ferengi would attempt rather than the Klingons. However, Rainn Wilson's malevolent version of Harry Mudd successfully elevated himself from a humorous antagonist to a first-rate Star Trek villain, with a lust for vengeance against a Starfleet Captain would rival even Khan (Ricardo Montalban) himself. Here's hoping Mudd's next return to Discovery is just as rollicking a good time.

NEXT: STAR TREK: DISCOVERY: IS LIEUTENANT TYLER A KLINGON SPY?

Star Trek: Discovery streams Sundays @ 8:30pm on CBS All Access, on Space in Canada, and on Netflix internationally.