Moved main JS around.