Moved prov graph to function