changes to graph code