starting to port to c++