Update mean.R