cleaned up visualizer code