building search functionality