First implementation of caches
Add count function to cache