adding update methods to matrix