calc mean and stddev