Add flow average calculation