submatrix method working