used jslint to clean up the code v2