modified the way scripts are generated