tidying up and correcting typos