Monte Carlo method implemented.