WIP - the cache approach, probably wrong