 cb_spacex = (r) ->
 	table = document.createElement 'table'
 	for p in r
+		core_reused = if p.reused then '*' else ''
+		capsule_reused = if p.reuse.capsule then '*' else ''
 		t_minus = p.launch_date_unix - (new_date / 1000)
-		reused = if p.reused then '*' else ''
 		switch
 			when (t_minus < 172800) # 2 days
 				t_message = (t_minus / unix_hour).toFixed(1) + "h"

				t_message = (t_minus / unix_day).toFixed(1) + "d"
		stream = [
			p.payloads[0].payload_id
			p.payloads[0].payload_type
			p.payloads[0].orbit
			p.launch_site.site_name.replace /(?=\D)\s(?=\d)/g, '-'
			p.landing_vehicle || 'expandible'

			('0' + new Date(p.launch_date_utc).getHours()).slice(-2) +
			":" +
			('0' + new Date(p.launch_date_utc).getMinutes()).slice(-2)
			core_reused + p.core_serial
		]
		row = document.createElement 'tr'
		for s in stream
			cell = document.createElement 'td'
			cell.innerHTML = s
			row.appendChild cell
		if p.reused
			cell = document.createElement 'td'
			cell.setAttribute 'id', "#{p.core_serial}"
			cell.setAttribute 'data-launch', "#{p.launch_date_unix}"
			row.appendChild cell
			reflown.push p.core_serial
		table.appendChild row
	document.querySelector('#content').appendChild table
	for ref in reflown
		loadJSON "{{ site.spacex_cores_url }}#{ref}?date=#{new_date}", cb_reflow
	return

cb_reflow = (r) ->
	launch = r[0]
	ele = document.getElementById(launch.core_serial)
	gap = ((ele.getAttribute('data-launch') - launch.launch_date_unix) / unix_month).toFixed(1) + "m"
	ele.innerHTML = "#{gap} #{launch.payloads[0].orbit} #{launch.landing_vehicle}"
	return

# XMLHttpRequest.coffee
