debugging done on graph,some minute errors remain