Update Matrix class