edited for flow