functions for caching the inverse of matrix