small improvement: don't override original matrix by identical one