added tests + jshinted