Updated mainForGUI to include visualizer