update Matrix, tests