rewrite find_or_next