add comments and typo fix