updated script generation