Added Miller-Rabin primality test