calculating confidence interval