adding code for Graphs