use of graph class to access other class