added comments to main.cpp