Better layout output writeCandidates() function