Update code to get cached inverse

Update code to get cached inverse