fixing the prime_numbers algorithm