Added functions to update the graph with new values