Added comments for each line of the script. Tested.