Improved: the candidate searching algorithm