Calculation of the Inverse of a matrix