removes redundant instructions