code comment and add some functions