add more logs. Use sets for storing cache keys