The final version of the script