Fixed jshint warnings, removed unused variables