Cleaup, comments, and better debug printing.