added brute inversion counter