fix typos, update logic, working