Added merge sort and counting inversions