Cleaned up table building code.
Corrected documentation.