use collections.OrderedDict() for the cache function