This is the updated function operating on a matrix to calculate the inverse