Added method to calculate standard deviation.