cleaned up and fixed jshint errors