updated the js files to follow jshint rules