Added comments on each main function block, file descriptions