added confidence interval calculation