new code for graphical