write function to cache inverse matrix
tested