Cleaned up main.cpp