saveFlow function partially implemented