state machine for Candidate