Update c++ code