Modified visualizer code