saveData now uses write.csv