isPrime() is now efficient