Matrix Inverse and caching