attempt at caching, still produces undesired results