updates graph