correct logic for iterators