Added iterate function.