added some doc, and fixed do