added stuff to graph function