added isPrime method