table generator and tests