fixed all the table stuff