Version 1 of the script