Working version with basic CACHE