add comments, remove trailing spaces