redesigned search function