bug fix and documentation