the script, with some comments