working on the toCSV() method