add comment

add comment and fix some bugs