He had an "enormous struggle" with the script, particularly encountering two problems while writing the script: showing "the memories, Joel's reactions to the memories, and Joel interacting with Clementine outside of the memories in the memories," and the fact that characters could refer in later scenes to already erased memories.