added initial csv writing/reading functionality