bug fix and comments

i fixed one bug related to show the number of character remained, and add some comments