Add generator script
Reorder some stuff