Made changes to cache matrix inverse