add comment and minor bug fix