search logic
merged