Now using the built-in functools.lru_cache instead of my own memo function