porting to c++
merging
merging