Try to write a c++ implementation
Try to write a c++ implementation