added some c++ code