fixed most of the jslint errors/warnings