more comments, added unused true to .jshintrc, removed unused variables
some refactoring