adding flow routine