Initial conversion to C++