Split the monolithic 'main.cpp' up in to smaller files + bug fixes