This is the C++ code written in my spare time.