Added isPrime method