tidying up the script