Worked on debug output and documentation.