some code on iterators and grouping of data