Updated generate script