update comment and format code