data structure for flow