Moved a huge chunk of javascript to later in the file.