implemented variables in prime_gen to limit output