remove unnecessary initializations
cpp version of count inversion algo