added Source Ref
added sanity check for graph