Silicon Valley thrives on chaos. For three years, the HBO tech comedy has been at its best when it’s nimble and free of the kind of end-of-episode resets that keep most sitcoms stable. For this show, disassembling the central premise over and over again and leaving programmer Richard Hendricks (Thomas Middleditch) and his friends scrambling for salvation isn’t just a way to shake thngs up. It’s the path to greatness.

By that measure, Silicon Valley’s fourth season might end up being the best thing the show’s done yet.

At the beginning of season four, the Pied Piper crew find themselves with a rare commodity: A promising new product, thanks to the video chat application Dinesh (Kumail Nanjiani) hacked together last season. The problem is, they can’t get anyone to even consider funding the venture after it was revealed last season that Jared (Zach Woods) was pushing fraudulent numbers for their failed application platform. When the team finally gets one venture capitalist to take an interest, they’re left with what feels like a very simple path: Get a million active users, get funding and get rich.

So, naturally, Richard is freaking out. While everyone else is celebrating the fast growth of the app, he’s so anxious that he’s biting his fingernails off. Faced with video chatting as the future of his company, Richard is forced to make a choice between what looks like certain profitability and quitting to pursue something new. Because this is Silicon Valley, he chooses the latter and sets out to build what he considers to be his ultimate dream project: A “new internet,” which he hopes to make completely free for all users.

This insanely ambitious plan sets Richard off on a new path, but it also upsets the entire Silicon Valley status quo. Now Dinesh and Gilfoyle (Martin Starr) have to make the video chat work, Jared has to adjust to life working for someone other than Richard, and Erlich (T.J. Miller) goes in search of a new blockbuster app from his in-house incubator that started the whole mess in the first place. Meanwhile, new changes also face former Pied Piper backer Monica (Amanda Crew) and former Pied Piper nemesis Gavin Belson (Matt Ross). Then there’s Big Head (Josh Brener), who … well, he just keeps right on being Big Head.

Upsetting the status quo is nothing new for Silicon Valley or its fans. This is a show that went from good to great at the end of seasn one when the main character threw out a whole year of work and literally rewrote it overnight. The mission becomes upsetting things in a way that both opens up plenty of new narrative possibilities and leaves viewers leaning forward at the end of each episode, anxious to see how Richard and crew will get out of their mess this time. It’s a Saturday matinee movie serial featuring programming instead of car chases. The minute that grows stale is the minute the show starts to degrade.

After three years of shifting around the Pied Piper compression app, repurposing it, winning funding and then losing it, the show had to go somewhere more ambitious. That’s where we get Richard simply deciding that his original idea and the things it has produced is no longer good enough. In the world of the show, Richard is almost a writers room unto himself, sitting in the corner jittering until he finally speaks up with an idea that launches a dozen new stories. This time, he quite literally wipes the whiteboard clean and starts over. It’s a bold move, even for a comedy that always functions with a certain level of baseline absurdity, that both invigorates and compels.

Richard’s choice to start over is made doubly compelling by the effect it has on the other characters. Silicon Valley was always destined to build from the story of one weird genius and his friends to a true ensemble piece. This season, that aspect of the show is stronger than it’s ever been. While Richard is building his new internet, Dinesh gets to grab some of the spotlight, showcasing Nanjiani’s acting chops and comic prowess in a way that he’s always deserved. Starr gets to play the agent of chaos of the group in even more amusing ways. With Richard off on his own, Erlich also gets to play up his always funny dynamic ith Jian-Yang (Jimmy O. Yang), creating one of the best accidental project gags in the show’s history. Plus, Gavin gets to grow beyond the bounds of antagonism, Monica gets to do something other than being the one sensible person in the room and Big Head continues to fail upwards in increasingly hilarious ways. Silicon Valley began its life catching heat for falling back too often on nerd stereotypes. This season proves just how far the show’s come since then.

Few sitcoms even attempt the kind of narrative highwire acts Silicon Valley goes for. Even fewer (fellow HBO hit Veep is one of them) can do it while still being tonally consistent and thoroughy hilarious. For three seasons, Silicon Valley has shifted alliances, restructured corporate agreements and overhauled products. All this while remaining a show about a group of guys who are either so smart they’re dumb or so dumb that they come back around to being smart. With season four’s new shake-up, the show not only flaunts just how good it is at holding everything together while constantly remaking itself but also opens the door for its most emotionally satisfying arc yet. One of TV’s best comedies just upgraded. Version 4.0 could be untouchable by season’s end.

Silicon Valley returns Sunday at 10 p.m. on HBO.