implementation of inverse caching matrix functions