added iterate function