Additional edits to search function