optimized monte_carlo error estimation. reduced computation time to 30% of original #275