Working on C++ port