Updated with C++ version

Updated with C++ version