ex 1.3.29 - fairly ugly solution to iterator