better graph updating