fluksod: use less loops for averaging