add some functions and comment.