Improve search algorithm.