made the search a bit more efficient