This is super amateur untested C++ here!
Includes and stuff
More untested code. Will it work?!?