fixed the bin size discrepancy
moved some common functions into the flow-fns library