Fix the given function to return the correct primes. 