tidied up with jshint