First attempt : based on cachemean example.