for if cycles rewritten to generators