update Graph code