making graph dynamic