Updating to C++ version