Added solution for caching the inverse of a matrix