adding to matrix