more documenting and typo fixing