Counting Inversions Using Merge Sort