This is a cumulation of C++ code that I've writtten over the years