building seach functions