adding debug messages into visualize.py, correction of HTML output