{Update} Fix bugs and add comments.