Count inversions - removed logging
Count inversions - removed logging