Fixing functionality and adding jshint