ADD some comments

some functions are hard to understand