Made main.cpp much more readable