Added comments to function in main program file.