implemented flow size calculation
proper testing according to example
removed init() method for performance reasons