making gen_spec a all in one script