Added inverse matrix caching fuctions