now the matrix is sensitive to the variation of cols and rows