converted to c++