tidy up the script