corrected prototype function definitions
jshint cleanup