fix bug, add comments.