redrawing graph