Implemented functions to cache inverse of a matrix