Vince Gilligan had been telling the story of a pie-eating contest gone wrong aboard the Enterprise to the writers of Breaking Bad for as long as writer Peter Gould can remember. “Since probably the first season,” laughed Gould, the author of last night’s season-5.5 opener, “Blood Money.” When it came time to give Badger another stoned (and yet amazingly coherent!) speech, Gould says he asked to borrow Gilligan’s Star Trek fan fiction, which involved an ill-fated Chekov and the gross misuse of the transporter. “We talk about Greek tragedy in the writers’ room, but there are a lot of geeks, so there’s a lot of geek tragedy, too,” Gould said.

Before Gould (and Charles “Skinny Pete” Baker) tells us exactly how this story came to be injected into the Breaking Bad episode, let’s relive Badger’s magnum opus … animated for Vulture by Matt Czap.

Badger’s Star Trek pitch (fact-checked by a Trek expert here) was dreamed up early in the writing of this last half of the season, when Gould and fellow Breaking Bad writer Gennifer Hutchison got into it over the true operational nature of the Trek transporter. The debate between Badger and Skinny Pete over how it works was lifted straight from their conversation. Gould, who said he was “a real Trekkie” as a kid, said he was the Skinny Pete in the argument: “I don’t want to go on a transporter because it’s essentially taking you apart and putting you back together. But Genni made a pretty good argument that that would mean there were literally 100 Captain Kirks.” He decided their debate (which no one won) was a natural way to get Gilligan’s gory lesson in transporter abuse on the show. “It would be the ultimate diet, really. Eat anything you want, and then Scotty beams it out of your stomach,” Gould said. “But like with great technology, there are terrible things that can go wrong.”

Matt Jones and Charles Baker, who play Badger and Skinny Pete, described themselves as “moderate” Star Trek fans, but admitted some of the story went over their heads. “I didn’t know what the fuck a tulaberry was,” Jones said. Gould confessed he had to research the berries as well. “I will admit that did not come too quickly,” he said. “I don’t believe there were any berries on the original Star Trek that didn’t have some sort of psychoactive, psychedelic effect. I had to reach to Voyager, and of course Skinny Pete calls Badger out on that.” (But was it Voyager, as Pete corrects? Vulture’s descent into Trek wikis find the tulaberry actually debuted on an episode of Star Trek: Deep Space Nine, but we would argue Skinny Pete was super-duper high and therefore can’t be held accountable for the error.) Baker lovingly referred to Gould as Breaking Bad’s “go-to geek guy.” “I think Peter loves writing those scenes because it doesn’t take much work for him,” Baker said. “It’s interesting. It’s such a great scene, but you watch it and you realize, ‘Wow, that scene wasn’t anything about us. It was all about Jesse. It was just to show Aaron Paul’s greatness at work without saying a word. We’re Muzak.’”