Work on C++ version, this is the one that needs the most help.