Modified original file to implement a caching technique based upon lexical scoping.