isPrime function added, primes renamed to getPrimes and based on isPrime