First version of isPrime
first version of isPrime