fix typos and tidy up