refactor all of the C++. Do not attempt to run.