Work on C++ version