working on submatrix