Added alternate version of #14 with caching.