updated CountInversions.java