corrected basic block generator