add some methods to compute invert of a matrix