Modified graph.R