of the episode, Phyllis returns to the office, pleased at the success of her party, where she and the camera crew walk in on Angela and Dwight having sex on Angela's desk. Production "Goodbye, Toby" was written by Paul Lieberstein and Jennifer Celotta. Lieberstein is also the actor who plays Toby Flenderson. It took Lieberstein and Celotta four or five days to write this episode. Writer Anthony Farrell said that the idea for Dunder Mifflin Infinity to fail was inspired by the days that he was an administrative assistant for Countrywide Home Loans. Farrell recalled watching the company try new online initiatives and seeing them all be unsuccessful. "Goodbye, Toby" was the seventh episode of the series directed by Paul Feig. Feig had previously directed "Office Olympics", "Halloween", "Performance Review", "Email Surveillance", "Survivor Man" and "Dinner Party". Feig was tasked with shooting many of the shots that would hide Angela Kinsey's pregnant stomach. To do this, he "looked for places around the office that could conceal her belly". Notably, the ending of the episode was shot in such a way that the audience could see that Dwight and Angela were having sex, but that Kinsey's stomach would not be seen. The talking head interview wherein Michael compares Holly to a baker came after what the writers call "blitzes", in which all the writers write a talking head on a specific topic, such as "Michael's feelings to Holly". Then they all read all of them out loud and see which one gets the biggest reaction. The YouTube video of Ryan being arrested was set on a private account. After "Goodbye, Toby" aired, the video was released to the public. When writing the story for the episode, the show originally planned on having Dwight put a badger in Holly's car, but after finding out that it was difficult to get a badger, it was switched to a raccoon. The script also called for the raccoon to attack Meredith, but that was decided against for safety reasons. During one of the takes wherein Michael is singing his parody songs, Carell grabbed a guitar and played an Eddie Van Halen guitar solo, but that scene was cut because it did not match Michael's character. After filming, the editors had about 72 minutes of material that they needed to cut down into 40 minutes. The script also included an un-filmed scene in which Jan reveals