moved row code into table code