added populate_of_flow() function