finishing miller-rabin-test