fix a few comments, and format the code