moving iteration to generator, everything is totally broken