jshint added and code cleanup