Improved search algo.