Added an explanation of how the script works