simplified FlatIterator
added back generics, better that way