Cpp version of PCR Calc