I had been wondering how the first season of "Silicon Valley" might wrap, as things had been looking mighty dour for Pied Piper in the last few episodes. As has been mentioned, long ago VHS beat out the superior Betamax technology, and Hooli seemed poised to do something similar by stealing the Pied Piper programming and making it their own. A complete failure for Pied Piper at TechCrunch wouldn't have meant the end of the show (it's already been renewed for another season), but it would have sent it spinning in a different direction, and likely a dark one.

Initially it seems that's exactly where we're headed, though, as even Gilfoyle and Dinesh look to jump ship and everything Richard does to save the project seems to be moving around deck chairs on the Titanic. That what eventually transpires, though it probably has real compression experts screaming, nicely takes us to the absolute edge and delivers a Hail Mary that may stretch plausibility but doesn't completely defy it.

But before we get there, we watch every member of Pied Piper pushed to the brink. Well, everyone except for Erlich, who got pushed pretty hard last week and, honestly, lives for this kind of stuff. Thanks to him being beaten up on stage, Pied Piper is not only sent through to the finals immediately, Erlich manages to get a hotel upgrade. "We're trending up," he crows, bursting into the sumptuous hotel suite like a hopped-up Tony Montana. Erlich in his element is good stuff, as watching him blunder (as we have in more than a few episodes) is sort of like putting a party hat on a tiger. If it doesn't immediately yield a lot of laughs, it's just a drag. 

Of course, the boys aren't really trending after all. When Richard sees Gavin's presentation, it's abundantly clear that the brogrammers have ripped off Pied Piper's code and Hooli has stitched in mail, search and other functions to make it that much more appealing to consumers. Worse, their Weissman score (a measurement created specifically for the show) is 2.89, the same as Pied Piper's. "Anyone who tells you their platform is faster than ours better have good lawyers," Gavin Belson boasts from the stage.

Faced with this bitter reality, everyone in the tiny start-up deals with the situation differently by picking different spots on the Kubler-Ross model. Erlich thinks they "just have to dial it up." As to how he defines dialing it up, he adds, "We have to act like any animal that's been cornered, acting erratically and blindly lashing out at anything around us."

As we know, Erlich is very skilled at blindly lashing out, and watching him try to commandeer Belson's interview with a bunch of tech reporters, throwing out rumors in a faux state of outrage that anyone would ever think such a thing, is pretty impressive. "The rumors, rumors unsubstantiated, of an impending crash of Hooli stock? Guilty or not, Gavin, I stand with you!" he barks, the combination of his black eye and wild facial hair making him look more than a little unhinged. It's probably as good of an idea as anyone has at this point, but it only pulls the media away for long enough to realize Erlich's full of crap. Then, it's back to square one. 

Jared, who is so fully sleep deprived from his accidental jaunt to Peter Gregory's island he doesn't know what he's saying, thinks they all just need to pivot. "Instagram pivoted! Chatroulette pivoted! We're gonna pivot!" he says, before running hysterically out of the room.

"That might be the last time we see him alive," Dinesh sighs. This really might be defined as Dinesh's episode, as his deadpan one-liners serve as the perfect soundtrack to what seems to be Pied Piper's swan song. More Kumail Nanjiani is never a bad thing, and watching Dinesh and Gilfoyle (Martin Starr) try to feel out a competitor for jobs only to get hit up for work themselves is another darkly funny moment. 

There's even a little sweetness in the episode when Monica tells Richard that, with Peter having seen Gavin's presentation Pied Piper is pretty much dead in the water, the up side is they can now go out for a drink. "You go on dates with failures?" Richard asks, after admitting that the death of the company is probably better for his health given that his stomach cramps are so bad he feels like he's menstruating.

I'm not sure that I buy it, as Richard has definitely had a few too many meltdown moments in front of Monica to come across as any kind of smooth operator. That she only suggested a drink and they didn't run off to an empty hotel room for a fling makes it more plausible, though, and really, at this point in the episode I can't begrudge Richard a tiny win.

When Jared (Zach Woods) gets arrested and guilelessly explains that the Adderall in his pocket "belongs to an underage kid I brought to my house," it's a sharp callback to a previous episode, and just plain good writing. This is the one episode Alec Berg ("Seinfeld," "Curb Your Enthusiasm" wrote this season, and I know he's busy with the directing and producing, but I wish he'd write more next season. After the pilot, this may have been the best episode of the season, and I think a lot of it was what was on the page.

Of course, we have to get to that Hail Mary pass, and it's jump started by the guys trying to figure out the mathematical equation as to how many guys in the audience Erlich could jerk off if he did two at a time. It's a dick joke, but one that becomes so elaborate and heady it works, and it also serves the purpose of giving Richard the idea to erase all his work and come up with something new. 

We know what has to happen once Richard decides to start over, but the scene is milked for every drop of tension -- even though Erlich begs the boss to "release the Kraken," Richard takes center stage, stumbles around, and finally shows his new compression formula -- which not only beats Pied Piper's (and thus Hooli's) but delivers a 5.2 Weissman. Richard doesn't just beat the competition, he demolishes it.

Investors flutter around, a cup is rewarded, and it's Richard's big moment -- until Monica pops by to yank him right back to reality. "You have to hire staff, get offices, hire an assistant. People may try to take credit and sue you. You could be managing thousands of employees by this time next year!" 

Richard, of course, promptly vomits. In a sense, it's an apropos bookend for the season (he puked when Pied Piper first got engines running in Silicon Valley) and a reminder that it's not a sprint but a marathon to get a business up and running. I'm sure next season will be flush with obstacles, and Hooli (or maybe some other corporate gorilla) will be lumbering after Pied Piper with a new dirty plan. This time, though, Richard and his merry men will be a little smarter, and that's all we can hope.

The only truly sad part about all of this is that, though the rest of the cast is dead-on, we won't be seeing Christopher Evan Welch again. He gave us an indelible character in Peter Gregory, and it feels a bit as if the solid center of the show has fallen out. I'm not sure how the actor's passing will be handled, but if another investor shows up to take Gregory's place, I hope the producers have a casting idea that's just as inspired as this one was. 

What did you think of the first season? Do you think Hooli will try to steal Richard's latest idea as well? Were you surprised Monica suggested she and Richard get a drink?