expanded search function