oops forgot to check in this version to solve the last mistakes in the unit test about the statistic numbers. My original code assumed one will first call mean() to calculate the average before calling stddev() and confidence(). However it seems the unit testing code does not follow my assumptions. Now I modify the code to always check if the average and standard deviation are calculated correctly before they are used.