added jshint and fixed some issues