added confidence interval function