playing with iterators

this is another of the book’s examples I looked through and got to work