changed so graph will update in real time