added jshint and reformatted