minor changes in logic of reducing basic blocks