tidy up whitespace and formatting