It seems like this isn't precise enough - if `n = 3, m = 0`, then `meanY` becomes `null` and the fn will return `NaN`