Wrote a table reader function.