Holtz wrote four additional drafts, each one darker than the previous, before leaving the project and giving Apatow the opportunity to take over the writing. Apatow and Stiller visited Carrey as he was filming "" in South Carolina, and over a few days, riffed a lot of the set pieces that were added to the script, and further explored how Carrey wanted to perform the character. Apatow took the film to the Writers Guild for arbitration to get a writing credit but ultimately Holtz retained sole credit for the script. Apatow expressed frustration at not getting credit but acknowledged that as he was also a producer on the film, the Writers Guild requirements are set very high to protect writers.