Add functions to make matrix that can save it's inversed state to cache