Computing inverse,caching it, using lexical scoping