added new comments and solve some bugs