implemented cachesolve for matrix inverse