void graph_plot() implementation. Fixed some bugs