code returns the inverse of a matrix