Split graphical functions from main into their own file