working out the iterator