Tru to write a C++ implementation