fixing indents
making debug output go to stderr
basic diagram generation working