Updated Search Logic