updated tree-by-matrix