 				cb data
 			else
 				# output to csv file
-				# do it later
-				cb data
+				data_array = []
+				for row in data
+					data_array.push row.join(",")
+
+				fs.writeFile self.output, data_array.join("\n"), (err) ->
+					if err
+						self.error err
+					else
+						cb data
 
 		self._parsefile func_formatoutput, self
 

		error_exit() if self.has_error()
		switch self.filetype
			when 'csv', 'raw'
				console.log self
				fh = fs.createReadStream self.datafile
				self.ready = true
				cb(fh)


	_parsefile: (cb, self = @) ->
		func_parsefile = (data_array) ->
			results = []
			
			switch self.mode
				when 'kinetics'
					
				else
					self.error "Unsupport mode!"

			cb data_array

		self._loadfile func_parsefile, self
