minor tweaks and pseudo-code to introduce the concept of a local cache