Added c++ code