 
 # pass `schedules` in
 .then () ->
-	console.log schedules
 	return schedules
 
 # process data
 .then computeDaysInSchedules
+
+# write data
+.then writeNdjson 'schedules.ndjson'
 .catch (err) ->
 	console.error err.stack
 
-# write data
-.then writeNdjson 'schedules.ndjson'
+.then () ->
+	console.log 'Done.'

			{ available: [], notAvailable: [] }   # saturday
		]
		for date in schedule.available
			days[moment(date).day()].available.push day
		for date in schedule.notAvailable
			days[moment(date).day()].notAvailable.push day

		for day, name in days
			if day.available.length > day.notAvailable
				schedule[daysOfWeek[name]] =
					default:	true
					exceptions:	schedule.notAvailable
			else
				schedule[daysOfWeek[name]] =
					default:	false
					exceptions:	schedule.available

		delete schedule.available
		delete schedule.notAvailable

		if not schedule or not schedule.start then return

		date = parseDate(data.date).valueOf()
		if not (data.exception_type - 1)
			schedule.available.push date
		else schedule.notAvailable.push date
