completed chapter 18 (custom iterators)