changed candidate logic