minor bug fix and add comments into code