added function to compute mean and standard deviation