Fix single-iteration function. Adding README and test file