Averaging engine
Slightly more optimized version with less copying