mostly added comments to main program