bug fix and comments