Added C++ functions