mergesort with infinite loop
fixed the problem