Quick hack to cache matrix inverse