memoized search