Reduced the number of instructions in merge alg.