cleaned up some of the visualization code.