starting a cpp version of the prime helper functions