Revised search functionality