Reordered the js file for easy viewing