Better computation of the confidence intervals. Also more code optimizations.