Graph code refactored (not re run), and reg explanation added