fix whitespace and organize some comments