Made code pass jshint tests