getCandidates() and candidates array functioning properly