write reference table.