add tsortRow to make sure the resuslt file is in order