Flow calculation optimization.
Change some lists to generators.