First version for cache matrix inverse