add comments and clean up output