added comments to sample main function