Refactored gen_special_vals.py