 Freiberger wrote the first draft as a freelance script at his parents' barn in Pennsylvania, and when he returned to the writing staff to rewrite the story, Freiberger took so many notes that the script became 106 pages long.As a result, Freiberger spent more time editing down the script rather than writing it.The episode's main plot, in which Lisa becomes a Buddhist, was pitched by Jean, who wanted to expand Lisa's personality.