visualizer set up; flattening