Fixed merge sort algorithm. TODO: graphic