add comment, fix typos and bugs