updated README.md with information about if-loop. Made a couple cleanups in the JS file.