--- from: http://rosettacode.org/wiki/Deming's_funnel