add loop merge sort and optimize block swap