“When you create a new start-up company, don’t forget to thank Satan.”

Seven recaps ago, our journey through the first season of Silicon Valley began with those words. On the season finale, “Optimal Tip-to-Tip Efficiency,” the devil comes to collect his claim on Pied Piper. Depending on your perspective, the outcome of TechCrunch Disrupt is either a defeat of Old Scratch or the beginnings of an even bigger deal with Rosemary’s baby daddy.

The episode starts with the mention of a very costly lawsuit, and ends … with the mention of a very costly lawsuit. Between the litigious bookends is a roller coaster of details and insanity expertly scripted by Alec Berg and directed by Mike Judge. There’s suspense, a bit of backstabbing, the ugly results of sleep-deprivation, a last-minute save, and a little romance. There is also a delectable appearance of the most beautiful language in the universe, math, spoken by the entire team as they plummet down the rabbit hole that gives the episode its title. You may not have understood those equations, but we can all agree that we can never look at hand jobs the same way again.

Last week’s Erlich beatdown by Dan Melcher for unlawful carnal knowledge of Mrs. Melcher results in the threat of a lawsuit. To settle out of court, TechCrunch pushes Pied Piper to the Startup Battlefield finals of Disrupt. It also provides a spectacular room upgrade at San Francisco’s Omni Hotel. “Congratulations, guys!” says a black-eyed Erlich, the architect of their good fortune. “I had to fuck a wife and take a punch, but now we can go into the finals without blowing our wad in the prelims!”

Unfortunately, Gavin Belson and his big announcement await our motley crew. Gavin presents his reverse-engineered version of Pied Piper, Nucleus, without actually demonstrating the product. “We’re breathing rare air here,” he tells the eager audience while revealing that Nucleus has the same Weissman score as Pied Piper. He further twists the knife in Richard’s back by stating “anyone who tells you their platform is faster than ours better have good lawyers.”

Gavin ends with the one thing Hooli didn’t reverse engineer from Pied Piper, Grammy Award–winning singer Shakira. Her hips don’t lie, but do Gavin’s lips? Is Nucleus really this good? Regardless, the Pied Piper team is thrown into a state of Fear and Loathing in San Francisco. Even Peter Gregory, who has seen his rival’s slideshow, waves the flag of defeat by calling Monica back to Palo Alto.

For much of the episode, it appeared that my earlier prediction that Hooli would destroy (or absorb) Pied Piper would come to pass. Richard is bummed and doesn’t want to present his software. And Gilfoyle and Dinesh try to sneak their way into another company by playing up just how great working for Pied Piper supposedly is. “Every day it’s like I died and went to hell,” says Gilfoyle, describing how a lot of folks feel about their jobs. After Dinesh explains to his potential new employer that hell is Gilfoyle’s Heaven, the employer asks if he can work at Pied Piper. Seems his company’s success is only theoretical.

Meanwhile, the ever-optimistic Jared pitches the notion of “pivoting” to Richard. He mentions that a lot of software companies started out as something different originally. Citing Instagram as an example, Jared demands that Pied Piper pivot toward doing something else now that Nucleus has cornered the market on compression engines.

Jared’s idea may be solid, but his extreme sleep deprivation sends him out into the public with a series of increasingly ridiculous survey questions. Trying to gauge what Pied Piper should pivot toward, he asks terrified people if they’d like a software that tracked kids via GPS or attracted rodents. His most insane idea is totally feasible:

“What if there were an app called Pied Piper that could tell you, to a statistical degree of certainty, whether you were going to heaven or hell?”

Even though I know the final destination of my soul, I’d still buy this app. It would work, because according to my old college professor, statistics is the “math of the Devil.”

Erlich Bachmann refuses to surrender. After accusing Gavin during a TV interview of having him beaten up, Erlich drops a hyperbolic statement on his team. “We’re going to win,” he demands, “even if I have to go into the auditorium and personally jerk off every guy in the audience.” After Dinesh estimates there are 800 guys present at TechCrunch, he and the team take a serious crack at creating formulas to determine how Erlich can, pardon the expression, pull this off.

While the gang crafts the perfect dissertation for math majors in the porn industry, Richard is inspired by their “tip-to-tip” theory. I loved this section; everyone is so realistically zoned out during their problem solving. Thomas Middleditch gives Richard the perfect crazed programmer face while he’s coding the new, improved Pied Piper, and I believed that the team would fill whiteboard after whiteboard with dick angles and acronyms for measurements. This is how the sausage is made (and massaged).

Seven recaps ago, I should have had more faith in Mike Judge and company. He loves his characters too much to saddle them with a dismal, dark outcome. Not even a last minute appearance by Murphy’s Law during the Pied Piper demo can prevent Richard from success. He even acquits himself somewhat by presenting a semi-coherent explanation of what Pied Piper software does.

A picture is worth a thousand words, and when Richard runs that picture through his compression engine, it yields the highest Weissman score recorded. Pied Piper officially kicks Hooli’s ass and wins TechCrunch Disrupt. For an episode so focused on hand jobs, it’s no surprise it resolves itself with a happy ending.

Monica congratulates Richard and details his bright future of the expanding company he will lead. “People are going to take credit for your ideas and SUE you!” she says excitedly, which of course, sends Richard outside to puke into a dumpster. This is the appropriate image to end Silicon Valley’s first season. I eagerly await the fresh hell of success that will populate season two.

Let me close out by expanding on that last point. Every scene with the late Christopher Evan Welch is a favorite. “Optimal Tip-to-Tip Efficiency” is dedicated to him, and when he pops up at the end, it’s a very poignant moment.

Thank you, dear readers, for putting up with this humble programmer. See you next season!