Improvements to commenting and formatting