More exhaustive tests, exposing bug in iteration funcion
Corrects bug in iteration function