Updating code to agree with jshint