Cleaned up the main.cpp