Decreased running time of monte carlo test