Although
Ricky Gervais came up with the plot of the episode and wrote parts of it on his own, the whole writing team of The Simpsons worked on the script and pitched ideas, as is done with all episodes. Gervais has said in interviews that he thinks he received too much credit for writing the episode, claiming he merely sent his plot ideas, along with some written scenes, to Jean through email, and it was then the staff of the show that "made it look like a Simpsons script." He commented in a Dazed & Confused article that "I'm going to get the credit, but I think everyone in the industry knows it was a joint effort." One of the scenes that Gervais wrote himself was Charles' love song for Marge, which later appeared on the 2007 soundtrack album The Simpsons: Testify.