switched to generators, now uses itertools