exercise for defining custom iterators