isPrime Method fixed