Added method to write students to csv file