Added a feeble attempt at caching the tables.