reset loc btw loop iterations (because hoisting)
add tests, jshint cleanup