C++ Implementation