Caches and Returns inverse of a matrix