Author requested functions.

Start with just adapting the functions provided as an example for
caching the means.  Do this as requested.