update C++ code (12/16)