Making the inverse of a matrix