listPrimes function completed