Write the script