Add averaging snippet