removing useless instructions