format the doc and add comments