port fitter to c++