adding the mean function