added a helper function and struct named RowData