fixed generator logic