split_inversions.rb finished and tested.