fix typos and improve comments