Added header documentation and cleaned up main method so the output is nicely formatted.