Updated the cached inverse function with comments