This is the latest complete version of the script