Added functionality to switch between visualization modes