speedup of monte carlo test for raspi