Learning Exercise for Refactoring loops into Iterators