problem 2 finished
p3: complete with helpers for primes