reverted C++ code