generator function for blocks of steps