start adding c++ implementation