improve comments and fix indent