Added code for caching inverse of a matrix