def monte carlo simulation