rewrite primes generation
refactor a lil + fix 3
problem 27