Update graph code