Adding cpp version