Work on porting to C++