added the verified version of the CountPowerPairs Code