solution to search