added code to convert a table