added init C++ code