sorting using Mergesort lag.