mento carlo implementation