Updated generate tables script