add some comment

and fix some bugs