fix typos, add functionality