 The writer, Andrew Kevin Walker, completed two separate drafts of the ending.  The first is the one that we see, and the second is one where John Doe is  killed by Somerset instead of Mills. This alternate ending sequence was  storyboarded and is included in the published script, but never filmed.