Modifies Bubble and Merge sort