cleaned up tables.c