Using the isPrime method