update for the matrix