Caching the inverse

caching the inverse of a matrix rather than computing it repeatedly