Implementing better lru cache