updated generate script