fixing the cpp version