improve graph.m