Add some comments. Refactor Output.