generalized, continued working on flow