cleaned up code per jshint