some c++ adjustments