fix typo and add a few lines