added optimization: Now removing unnecessary NOPs