"You must think we're such dummies," an exasperated J.J. Philbin tells me.

This is somewhere in the fourth of five hours I'll spend at the writers offices of "New Girl" late on a Friday afternoon in January, watching as the show's writers work on a story outline for "TinFinity," the 18th episode of the terrific FOX comedy's second season. (It aired last night.) As Philbin suggests, it has not been coming easily to them on this day.
 
The staff has been working on “TinFinity” in one form or another for weeks. The episode’s credited writers, Kim Rosenstock and Josh Malmuth, put together an outline over Christmas break, involving two stories. In one, Nick and Schmidt throw a party to celebrate their 10th anniversary as roommates. In the other, Jess tries to make out with football star Jax McTavish to take her mind off of her recent kiss with Nick — “I need a new mouth on my mouth” is a proposed line of dialogue that will be said over and over throughout the day — only to be hamstrung when Jax accidentally walks in on her while she's using a porta potty. They wrote a draft after the holiday, but everyone feels the ideas need more fine-tuning — particularly the Jess/Jax story — to help set up what’s going to happen in the episode after “TinFinity.”
 
“Because we’re in the back half of the season where we know where things are moving,” explains one of the show’s executive producers, Dave Finkel, “we’re taking a bunch of steps forward and then looking at it through the prism of how things should be breaking, and then going back and fixing things. I think we made some assumptions about the way things are breaking, and then we realized, ‘No, they’re not quite right; we need to recalibrate based on this over-arching story.’”
 
This re-breaking of a story isn’t unusual in the comedy business. Finkel and partner Brett Baer have worked on a variety of half-hour series — everything from “30 Rock” to “United States of Tara” to “Joey” — and Baer says, “I would say most shows will re-break after a draft comes in. It’s not like you’re throwing everything out — the baby with the bathwater. Every show we’ve been on, the draft comes in, and then we talk about it.”
 
In this case, the ones talking about it — and about the Jess and Jax story in particular — when I arrive are Finkel, Baer, Malmouth, Rosenstock, Philbin and Luvh Rahke, plus writers assistant Sophia Lear and executive producer and director Jake Kasdan. The day before, Kobe Bryant randomly showed up on set to hang out, and all are still raving about his star presence, and trying to draw some inspiration from that for the writing of Jax McTavish.
 
“I don’t like fake famous,” says Philbin, sparking a debate over whether a fictional celebrity ever seems plausible on screen. Meanwhile, the writers go back and forth on whether Jess should kiss Jax before or after the porta potty incident, and whether they want that to be what derails them as a couple or simply Jess’s recognition that she still has feelings for Nick.
 
“New Girl” creator Liz Meriwether is down on the stage supervising the episode being filmed that day, but she calls to check in. Over the speaker phone, Baer explains their Jax concerns, and Meriwether suggests they could beef up the character by having Nick be impressed by him, as well. Rosenstock suggests that Nick might be confused over whom he’s more jealous of: Jax or Jess?
 
There’s also the matter of tying Winston into the story. The idea is that Winston has met Jax at the radio station, but nobody’s sure how Winston gets Jax from the station to Nick’s bar, or what his ultimate role will be. One idea being talked about is Winston giving Jess a crash course in football. Rahke proposes that Jess explain, “I’m more of a visual and smells learner,” to big laughter from the room. (The line, like so many that are a big hit in a sitcom writers room, will not survive to the final version, in part because the story changes to leave no place to put it.)
 
Meriwether hangs up as Katherine Pope, another executive producer and president of the show’s production company Chernin Entertainment, arrives. Baer fills her in on where they are, and talk quickly shifts to who will play Jax. Size is a limiting factor — there aren’t that many actors of the right age who are both funny and will seem believable as an NFL star — and Pope suggests Steve Howey from “Shameless,” who used to play a football player (albeit arena league) on “Reba.”
 
Pope is primarily concerned with who is driving the action here. In one version, for instance, Jess is reacting to Nick taking the phone number of another woman, rather than initiating the action on her own. Drive is one of the most-discussed topics in the room.
 
“It's the essence of storytelling,” Finkel explains later. “If the audience doesn’t have a clear idea of who’s going after what, it’s impossible to laugh. If people are trying to figure stuff out, if it’s unclear, if it’s muddy, they don’t laugh because they're working too hard with the left brain to make sense of it, and then they can’t enjoy on a more instinctive guttural level what the jokes are.”(*)
 
(*) Though I do hear jokes pitched throughout the day like the “visual and smells learner” line, the show’s writing staff is divided during my visit between the people re-breaking the “TinFinity” story and the ones in the next room writing dozens upon dozens of alternate punchlines — what in the comedy business are referred to as alts — to be thrown at the actors during filming so Meriwether and the show’s editors can decide which gag ultimately plays best. According to Baer, “Mike Schur” (co-creator of “Parks and Recreation” and Philbin’s husband) “calls our room ‘The Salt Mines of Alt-ville.’”
 
As they move back and forth through the story again, Philbin suggests Jess get Jax to forget about the bathroom situation by giving a variation on Julia Roberts’ famous “Notting Hill” speech: “I’m just a girl, standing in front of a guy who saw her poop.” Finkel grabs the phone and claims that they’ve just won a Humanitas Prize for the idea.
 
Pope and Kasdan exit a few minutes later, but the debate continues over every possible iteration of every beat of the story: Does Jess see Nick get the phone number? Does she get it on his behalf to prove that she’s over him? What scene will they cut to the opening credits from?(**) As the minutes tick by, everything seems to be in flux except Jess saying “I need another mouth on my mouth” and the embarrassing incident at the porta potty.
 
(**) Whomever is running through the current version of the outline (usually Baer) will recite one story beat after another, then race through the “Hey, girl, whatcha doin’?” opening line to the theme song to signal the break to credits. The final version of the episode is so long that it gets the abbreviated theme, with no “Hey, girl.”
 
This is par for the course at “New Girl,” where the writers break and re-break stories over and over until everyone’s satisfied they have the funniest and most emotionally resonant version of it ready to go. “Fancyman,” the season 1 episode where the series seemed to find its voice, was originally built around an Occupy Wall Street-style protest before the angle was ultimately dropped. When Rahke jokes that they should change Jax to a British guy, Rosenstock groans, recalling a long time spent on a previous episode working on a British character whom they later scrapped.
 
“We’ve broken nine seasons of this show, at least,” speculates Malmuth.
 
Kasdan briefly returns at one point and remarks that they’re all in the same positions, working on the same problems as when he left them two hours before.
 
As the writers take a break, one yawns and jokes, “There was a time in my life when I didn’t know the words ‘New Girl.’”
 
When Philbin, Rosenstock, Malmuth, Rahke and Lear reconvene, answers still aren’t easy to come by. The current outline has Winston keeping track of Jax as part of his job, babysitting him for some kind of station promotion, but no one is sure how much, if at all, viewers care about Winston’s job.
 
Philbin gets up to study the whiteboard where the outline is written, then rests her head on Baer’s desk and asks, “God, why is this so hard?”
 
“I don’t know,” Malmuth replies.
 
From out of frustration comes inspiration. Philbin grabs a second whiteboard and begins a brand-new version of the outline. The empty surface seems to recharge the batteries of everyone in the room — it’s a fresh start, rather than moving the same pieces around and around — and almost immediately they lock on a Winston angle that makes sense: as a failed pro athlete, he’s desperate to befriend a real one, and views Jess’s attempt to seduce Jax as something that could ruin his budding friendship with the guy. Now, he has that all-important story drive they were discussing earlier. Rather than just commenting on the action, he has a goal himself: to get between Jess’s mouth and Jax’s by any means necessary. They had always planned to have a touch football game at the party as an excuse for physical comedy, and now Winston will suffer for trying to block Jess’s play.
 
“I feel we reinvent the episodes until the very last moment,” says Philbin. “We are not scared to throw things out.”(**)
 
(**) It’s only after they’ve cracked the code that Philbin turns to me with the “dummies” line. It’s easier to acknowledge how long it took you to climb the hill once you’re nearing the top.
 
There’s a palpable sense of relief in the room, particularly after Finkel and Baer return and are pleased to hear the new approach. All agree this is a better idea than Winston teaching Jess football, which Malmuth calls “a soft premise.”
 
“We can come up with something,” says Baer. “We just have to put the work in.”
 
Meriwether enters, moving from one showrunning task to another — in a few minutes, she’ll be interrupted by a crew member telling her, “We need a cat decision,” to which she decisively replies, “We prefer 10 live cats.” — and listens to Baer deliver the new pitch. She sees potential in the new Winston angle, but is now concerned about what Jess is getting out of the conflict.
 
“I feel like it could get there, but it’s not there yet,” she says. But after more discussion, she declares, “I think you’re in a good zone with that.”
 
“At 8:30 on a Friday, she said, ‘It’s alright!’” declares a relieved Finkel. Earlier, Malmuth had referred to the afternoon as “an athletic story-breaking,” but all are satisfied the extra time was worth it, and that the story is in much better shape than when they started.
 
This is the end of my visit, but far from the end of the process of working on “TinFinity.” The writers are there that night until 11, and Baer and Finkel until 2 in the morning, first working on the eponymous story about Nick and Schmidt’s anniversary before everyone is assigned a different part of the outline to flesh out.
They work over the weekend on their assignments to create what’s called “a Frankenstein draft,” because on Sunday, Baer and Finkel have to stitch the different pieces together into a cohesive whole, which they’ll then polish with Meriwether all the way through to the table read by the whole cast on Tuesday.
 
That Monday before any table read often turns into an all-nighter, which Finkel and Baer both compare to the atmosphere at “Saturday Night Live.”
 
“Dave and I and Liz will often like end up spending that next table read here at the office and then taking shifts of sleeping breaks of two hours or whatever,” says Baer. “And then we get up and keep going. It doesn’t always happen that way but when you feel the clock ticking, there’s an excitement about trying to get it into shape. And there’s always a moment at about 2 in the morning when your eyes are blurry and you look at it and you go, ‘Is this a thing?’ And then when you start to see, like, ‘Holy shit, it’s actually coming together,’ that’s the good feeling.”
 
“In a lot of ways it’s very exciting and horrible,” says Finkel, “and I’ll tell you what there’s no more euphoric feeling — even in our worst moments when the table read has just hit the shitter. After the table read, you’re like, ‘Oh my god, that was weird and exciting and horrible.’ Every emotion just rolls off you. And then you let down and feel, ‘Okay, that happened. Cool.’ It’s pretty intense.”
 
The “TinFinity” table read goes reasonably well, but everyone agrees on two things: 1)The character of Jax (who will, indeed, be played by Steve Howey) needs to be beefed up, and 2)The gag about Jax seeing Jess going to the bathroom, that has survived every other tweak to the script, isn’t as funny in execution as it was in the idea stage.
 
“It didn’t feel like it reflected like what we wanted the dynamic between Jess and Jax to be,” explains Finkel.  “We wanted something a little bit more substantial and a little weird, and it just didn’t quite work by itself.”
 
So the writers dive back in and reconceive Jax as a guy who’s very in touch with his feelings, which for Jess is an appealing contrast to Nick — until it turns out he’s too in touch with those emotions, and winds up crying and declaring his love for Jess on their first date.
 
“That happens, like, once every like three or four episodes where we’ll get locked in,” says Finkel, “on this one set piece you want to do. And then, more often than not, that set piece becomes a bit of an albatross.  And you have to at some point realize you’re trying to fit a square peg into a round hole.”
 
“The story’s over here: this is the thing that actually is working or matters, this thing that people care about or follow,” adds Baer. “And sometimes you have to let go of like a joke or whatever.”
 
The story of TinFinity itself came together much more easily — Baer estimates that 80 percent of the Nick/Schmidt jokes from the table read survived to the final version, and 100 percent of the structure — because, as Finkel puts it, “That dynamic of those two guys trying to figure out the dynamics of their friendships generally tends to work for us.”
 
But they wrestle with the Jess/Jax/Winston material until they’re pleased — at which point Mother Nature decides to intervene. The entire second half of the episode takes place at the outdoor party, in a public park, and persistent rain kept delaying filming of those scenes — “It took us a month to shoot that episode,” Finkel sighs — so that the final cut was done only days before it aired.
 
In their initial version, episodes tend to come in at 27 or 28 minutes long, when the air version has to be cut down to 21 minutes and 35 seconds. And because so many different versions of each joke are filmed, the producers don’t really know what the episode looks like, or whether it entirely works, until right before editing is completed.
 
“The episodes really don't take complete form until hours before we lock,” says Finkel. “Liz is really kind of brilliant in getting in there and finding these odd gems that you didn’t expect to work. And they just turn themselves around.”
 
Finkel recalls Meriwether and editor Steve Welch’s work on the recent episode “Table 34,” largely set at an Indian wedding convention, which no one thought was quite clicking until they saw the finished cut.
 
“They really have a knack for re-creating the fabric of every episode in a way that’s surprising,” says Finkel. “That was one of those episodes were we looked at it afterwards and were like, ‘Wow, that was really kind of a heroic.’”
 
With “TinFinity,” the trick is to find enough time for all the important story beats of Jax and Jess’ aborted courtship, and Schmidt and Nick analyzing their friendship, and on top of that Cece accepting a wedding proposal from her boyfriend Shivrang — right in front of ex-boyfriend Schmidt, using the light show, confetti cannon and Queen song he was intending to use for his toast to Nick — while still leaving room for jokes. Though Jax never catches Jess using it, the porta potty itself survives —  when told by a salesman that the one he wants is going in the garbage, Nick scoffs, "’Garbage.’ That's what the nursing home said about my mattress.” — and is used as part of the conflict between Nick and Schmidt.
 
All in all, everyone is pleased with how it turned out, given the difficulty in breaking the story, followed by the weather disruptions. But there’s no real time to celebrate, because there are new stories to break, new alts to be written, scenes to be shot and edited, as the business of show requires team “New Girl” to keep powering through until the last joke in the last script of the 24th episode of the season is as good as it can possibly be.
 
Alan Sepinwall may be reached at sepinwall@hitfix.com