Added fast count inversion