The episode was written by freelance writer Howard Gewirtz. It was one of many stories he pitched to the producers of the show. According to executive producer Al Jean, Gewirtz's script ended up featuring one of the longest first acts (an act being the amount of time between commercial breaks) in the history of the show when the episode was completed. Gewirtz's script originally contained two uses of the word "ass", once from Bart ("bad influence, my ass") and once from Burns ("...kiss my sorry ass goodbye"). This was the first time a character in the show had used this word, and it led to problems with the network censors. Eventually, the censors forced the producers to remove one instance, so Bart's line was changed to "bad influence, my butt". However, in the first rerun of the episode, this decision was reversed, with Bart saying "ass" and Burns saying "butt". (The official DVD release has the dialogue from the original airing.)