When New Girl first hit the airwaves in 2011, it was billed as being all about Jess (Zooey Deschanel), a quirky teacher trying to figure out her life after a serious breakup by moving into a Los Angeles loft apartment with three dysfunctional men. (If there were any doubts about which character was the primary focus of the show, the opening credits did their best to dispel them, with the male characters acting as stagehands while Jess sang and mugged for the camera.) The show had been sold entirely on the back of Deschanel, the “adorkable” movie star stepping into the sitcom world, and its early episodes focused mostly on Jess’s romantic and professional misadventures.

At some point, though, things changed—to the point where the Fox sitcom, which aired its 100th episode Tuesday night, was able to replace its star entirely with another character played by Megan Fox, to cover for Deschanel’s maternity leave. Fox’s guest stint didn’t just reinforce how much the show has evolved past its initial premise—if anything, losing Jess made the show better than it had been in years. Tuesday’s episode, in which she finally returned to the loft, felt almost jarring, upending the inspired new directions the show had pursued while she was gone. The standard model for network sitcoms is to obey the status quo, and snap back into default settings again and again (think six friends sitting around a coffee table in Central Perk, or bantering over minutiae at Monk’s Diner). But this season of New Girl has proved how much that can disable storylines and characters, and how sitcoms might benefit from drastically shaking things up.

The show has always thrived on unpredictability. Its creator, Elizabeth Meriwether, who’s long been refreshingly forthright about her creative process, quickly realized the strength of the supporting cast around Jess (Jake Johnson, Max Greenfield, Lamorne Morris, and Hannah Simone) and recalibrated New Girl as more of an ensemble comedy midway through its first season, a “hangout show” about a group of friends dealing with minor romantic and work-related flaps. Like Friends or How I Met Your Mother before it, New Girl’s shtick didn’t amount to much more than the age-old question, “Isn’t it hard to be a grownup?”

In season two, Meriwether hit the throttle on the burgeoning relationship between Jess and Nick (Johnson), the kind of will-they-won’t-they romance that other sitcoms would have dragged out for years. Suddenly, New Girl was less of a “hangout show” and more of a straight romantic comedy, as the boorish Nick struggled to keep up with Jess’s more precious interests, and the rest of the gang turned into a peanut gallery snarking at their ongoing affair. It worked better than it should have, partly because Deschanel and Johnson had tremendous chemistry, but it also unsurprisingly robbed the show of its dramatic tension.

So a year later Meriwether broke them up, an equally surprising move considering the popularity of the pairing. She admitted in an interview with Hitfix’s Alan Sepinwall that she’d struggled to mine interesting stories from a mostly stable relationship. “We couldn’t push the envelope as much as we wanted to. We were pulling our punches a little bit, trying to make it fun and believable that they were in love with each other,” she said. “It felt like we had to see them together in every episode, and that limited Nick from going off on his own and having stories.”

Which leads to Megan Fox. Since breaking up Nick and Jess, New Girl has leaned hard into its status quo as a wacky sitcom about 30-somethings struggling to master life. But it’s felt more and more strained as the cast has grown up (Deschanel is now 36, Johnson 37) while their characters’ development has remained arrested. So when Jess took a break from the show for a month (officially, she was sequestered in a hotel on jury duty) and was replaced by a new tenant, Reagan, the dramatic turnaround was remarkable.

Megan Fox is not, and has never been, a particularly funny actress. But Meriwether played to her strengths, writing Reagan as sardonic, distant, and perplexed by the bizarre closeness of the loft’s residents. She laid bare just how comfortable the New Girl gang had gotten in recent years, and Meriwether was clearly delighted to start pulling that situation apart. Reagan was like a new viewer tuning into the show, initially savaging it with withering criticism, but then slowly coming around to its charms.

The show went the easy route by having Nick fall for her—he was the only real option, since two of the other main characters, Schmidt and Cece, are engaged to each other, while perpetual third wheel Winston has fallen for a co-worker played by Nasim Pedrad. But where Nick and Jess’s dynamic was defined by her attempts to fix him (foolhardy from a comedic perspective, since Nick’s at his funniest when he’s being slovenly), Nick and Reagan’s relationship felt more thematically appropriate, since their attraction lay in their mutual disdain for storybook romance. Even better, it was interrupted by the return of Jess before it got a chance to resolve, leaving more threads for the show to pick at as the fifth season closes out.

The mere fact that the show didn’t really need Jess around to function has its own fascinating implications. Getting to 100 episodes has long been a special milestone for a sitcom, since it traditionally signified the moment a show could be sold into syndication and essentially play in repeats forever. New Girl isn’t a ratings killer for Fox, and until now it seemed like it was limping toward an inevitable conclusion with Schmidt and Cece’s wedding. But it has clearly has a chance to remain interesting, even with Deschanel back. If Jess and Nick snap back to their old habits, then the show may truly be out of ideas. But if it acknowledges the outsize impact Fox’s guest arc had—and explores the startling idea that Jess may not be as essential to the group dynamic as previously thought—then there’s no reason to think New Girl couldn’t carry on for years. Or that other sitcoms couldn’t benefit by doing the unthinkable.