added the C++ source code