Adding graph implementation