switched to ECMA 6 iterators