Vastly improved the search agorithm