Added the compiled functions and the new calculatePcalCpp