some added comments in main