Added mainloop call in visualization.