working on flow functions