Update main.cpp

refactoring and a few comments