changed the way on how to decide what item should be removed from the cache