mostly changed the table generator, some templating stuff too