add comments, modified some methods