Updated with merge sort