Adding C++ Implementation