added gen_prime