a lot of code changes for visualizer demo