Revised search implementation