edit carrot cpp to fixed bugs