implemented caching lru-cache