Improved commenting and minor improvements to output