added jshint and improved example