Adding in the example for caching means.
Complete source for caching matrix inversions.