There is much to like about season three of Silicon Valley so far. Picking up right where the last season left off, we get a funny but realistic look at the ego of Richard Hendricks, who has just been removed as CEO from Pied Piper (the company he founded) by the venture capitalists who comprise his board. Richard’s decision is to resist, threaten to resign from his company, and reject his funders’ plan to make him Chief Technology Officer. This sets up a complex and compelling arc for the rest of the season: the experience of no longer being in charge of your own signature creation. How very Steve Jobs.

The episode, appropriately titled “Founder Friendly,” was written by Dan O’Keefe, who penned the season two finale as well as other historic TV—the Festivus episode of Seinfeld for example. It’s no surprise then that this episode of Silicon Valley is full of dynamic emotional conflict. The way emotional irrationality can quickly raise the stakes is a comedy gold mine and O’Keefe immediately digs in, with one of the results being the enraged screaming of the words “fucking Stanford robotics” on national television. Hysterical.

Watching an ego trip unfold can get tedious, but Richard’s freak-out is well paced over the course of the series and this particular episode. For as much vanity may be running through the real Silicon Valley, this side of Richard’s character has mostly been hidden until this point, so it felt well earned and appropriately placed. It showed complexity without dragging on too long or making Richard, a fundamentally sympathetic character, seem whiny or entitled. It set up future tension between him and Gilfoyle and Dinesh, Pied Piper programmers whom he assumed would resign with him in personal solidarity.

Richard shops around for other companies to go to work for, including a startup whose business plan is to superimpose mustaches on people in video in real time. Their willingness to flatter Richard at every opportunity becomes almost too much for him to resist, but by episode’s end, he shows some comfort in staying at Pied Piper and sorting out his differences with replacement CEO Jack Barker (played by Stephen Tobolowsky, that guy you’ve seen in everything).

In one episode we have broken alliances, tentative partnerships, and tons of interpersonal volatility, which puts us in a good place for a Mike Judge comedy.

Just like in Office Space and King of the Hill, the more we get to know the characters, the funnier their struggles become, and the quicker the writers can set the pace for pathos, plot, and jokes. Middle to later seasons of good comedies are typically denser and more rewarding, and Silicon Valley is on the same path. The writing is hitting a tremendous stride in putting characterization first, letting the characters determine how the plot unfolds. The result is both funny and genuine.