Finished conversion to C++