added write to csv method to Candidate