modified mean.R