Updated regenerate script