Added methods to cpp.