More work on C++ port
More work on C++ port