cleanup, moving to c++ instead of just C