clean up comments, formatting, warnings