Removing unused codes, adding comments.