integrated version 2.1
bug fix and add comments
bug fix