functions for cache inverse matrix