Update main.cpp

Code reviewed, added some comments to it