updated Graph.cpp and Graph.hpp