changed to the proper function to compute the inverse of a matrix