Adding chi-squared Monte Carlo simulation.