tgraph.r modified