added a graph.java for visualization