public void Add(float val) { if (buffer.IsFull()) { avg -= buffer.GetAt(0); } var newVal = val / size; buffer.Add(newVal); avg += newVal; }