fixed inversionCount