“Silicon Valley” had a chance to say something important. Faced with a software intellectual property case mirroring the same core concepts as the Google v. Oracle API copyright case looming over the tech industry, the show that’s gained enough street cred for humor and realism both with coders and a general audience positioned itself for the opportunity to make a statement.

Instead they wrapped up the case in Pied Piper’s favor with a convenient loophole in Richard’s Hooli contract that made his employment—and Hooli’s claim over the Pied Piper algorithm—invalid.

In fact, on its merits alone, Hooli won. The arbitrator in the sealed binding hearing said as much. By the letter of the law, Richard used Hooli equipment to test the Pied Piper algorithm, and thus Hooli has a right to ownership of Pied Piper’s underlying IP. If it weren’t for the contractual loophole, held back by the arbitrator for no other reason than dramatic effect worthy of the “I have bad news” doctor from “Arrested Development,” Pied Piper would’ve been Hooli’s.

The case’s resolution was a mildly disappointing cop out at the end of a middling second season for a comedy that initially stood out largely for its ingenuity.

Higher ambitions aside, it was a highly entertaining season two finale.

(Related: Catch up on the whole of ‘Silicon Valley’ Season 2 with our recaps)

On “Silicon Valley,” the company’s blunders usually lead to unexpected success. It’s a pattern the real Valley wants desperately to believe in: the remodeled American Dream of failing and learning from that failure before you can succeed.

So when Richard made the hotheaded decisions to take on Hooli and then End Frame in live-streamed video compression instead of pursuing other, more creative applications of Pied Piper’s algorithm, it only makes sense that it would lead to Pied Piper inadvertently live-streaming a “127 Hours”-style rescue of a worker trapped by boulders (after being sent to take down the camera for live-streaming a condor egg hatching.) Live-streaming it flawlessly with no blocking and re-buffering events below 5%.

As Richard sat in court losing and then winning his case against Gavin Belson, the live-stream went viral, ballooning to more than 300,000 viewers while Dinesh, Gilfoyle and even Erlich—finally putting his literal coding gloves back on in the wake of having his entrepreneurial acumen destroyed last episode—tear the incubator house apart to scale their homemade datacenter up to handle the load.

This season hadn’t given us much in the way of a glorious techie version of an action scene, but this was it.

Gilfoyle hammered through a wall of the house to run wires closer from the servers to the operations room; Dinesh and Erlich used Varnish to code caching mechanisms on the fly to make sure the clusters would scale. It’s the “Silicon Valley” version of a slow-motion shootout, even ending in flames as a server caught fire right as the worker was rescued. The live stream stayed perfect until the very end.

The scene even came with a chase element, as Richard—phone dead, car keys accidentally dropped down a drain—rushed back to the house to stop the team from “nuking” the Pied Piper codebase. He gave the order when he thought the case was lost, of course, to keep the algorithm out of Gavin Belson’s hands.

At its heart “Silicon Valley” is a sitcom though, so the gang procrastinates pushing the metaphorical big red kill button and Richard gets there in time. That algorithm is the show, or at least what the show has become reliant upon, so the chase was ultimately a low-stakes one.

The stream was a success. So successful that Raviga Capital decided to re-up with the startup, buying out Russ Hanneman (who now “has two thumbs and three commas again.” Good for you, Russ) and taking control of the Pied Piper board. As much as I’ve criticized “Silicon Valley” for veering too far from real-world plotlines, payoffs and consequences, what happened next was a jolt of reality.

This season Richard made all the wrong decisions. So did Gavin Belson. In a blind effort to beat each other, Richard grabbed money from the wrong person, spent it in the wrong places, focused on all the wrong goals and almost destroyed his own business 10 times over. Belson burned piles of money tanking Hooli XYZ and promoting Big Head over and over, pouring endless resources into the fundamentally flawed Nucleus platform (they never cracked Richard’s middle-out compression), and generally turning himself into a laughingstock in the tech world.

Both ended the episode by getting fired. Belson goes into a Hooli board meeting with the solemn look of a man who knows he’s failed. As the team is celebrating that night, Richard gets a call from Monica. He’s been voted out as CEO of his own company.

At a certain point when you’re the head of a company, no matter the size, you can’t keep making the wrong decisions. Richard’s management style was one of the season’s biggest issues, but now we know it was by design. Yet “Silicon Valley” will be back next year with a much-needed new dynamic for many of its main characters, and for Richard, it’s another critical failure on his way to success.

Odds & Ends:

  • Big Head keeps moving up in the world. Apparently being promoted so many times in a year gives you a good reputation. Would creator Mike Judge really replace Belson with Big Head as Hooli CEO? It’s entirely possible. He has Gavin’s yes-man shaman to guide him now, so the sky’s the limit.
  • In the absence of Peter Gregory after actor Christopher Evan Welch’s sudden passing last year, the show was poised to reinforce strong female character development by putting Monica into a pivotal role in the VC firm. It did not. Monica was barely seen the second half of the season, reduced to the continual bearer of bad news with no real stake or control in Pied Piper’s future or the show’s advancing plot. You really dropped the ball there, Judge.
  • Erlich was never selling his house. The show’s comedic anchor looks to finally be turning toward a new phase, professionally and personally, and the show can only get better if he does. T.J. Miller is “Silicon Valley’s” unquestioned MVP.
  • Gavin and Richard’s halfheartedly touching moment in the bathroom, Richard trying to tie his tie looking down at instructions on his phone until Gavin helps him out, was a great little scene. Whatever roles and dynamic the two ex-CEOs hold next season, Richard and Gavin’s relationship will be one of the more fascinating ones going forward.
  • Jared had a quietly great episode as the show’s moral center. Erlich’s heart-to-heart with Jared as he explains why he spurned his stable career at Hooli for a volatile startup was genuinely deep. When Jared says to stop and look around at “the magic” happening, he believes it.
  • A mother pushing a stroller runs faster than Richard as he races home to stop the “nuking.” Nerdy gag jokes never get old.
  • Richard’s line of the episode: “We’ve had no resources and we’ve hit an endless stream of obstacles. I want to see how big [Pied Piper] can get right to the point where Gavin Belson takes it from us,” he said. “Isn’t that the reason you got into this in the first place? To build cool s**t?”