Add pt.writeRow to handle writing out rows