used jslint to clean up the code