tidying up script