update to matrix