 
 						#once all clients are finished, then we're finished
 						#print report and exit
-						if finishedClients.length == clientAddresses.length
-							console.error "All clients finished. Wrapping up."
-
-							report =
-								testCount : results.testCount
-								testsPassed : result.id for result in results.testsPassed
-								testsFailed : result.id for result in results.testsFailed
-								testsErrored : result.id for result in results.testsErrored
-
-
-							console.error report2string report
-
-							endTime = new Date()
-
-							console.error "Running time: #{(endTime - startTime)/1000} seconds"
-
-							#TODO: kill processes, then exit
-							#serverClientComm.killClientProcesses()
-
-							process.exit results.testCount == results.testsPassed
-
+						if finishedClients.length == clientAddresses.length then finish()
 
 				when "/statechart-initialized"
 					#signal recieved when a statechart is initialized

		forwardX11 = args['-forwardX11'] or (xserver is 'Xephyr')
		projectSrcDir = args['-projectSrcDir'] or '/home/jacob/workspace/scion'
		fileServerRoot = args['-fileServerRoot'] or "#{projectSrcDir}/build"

		console.log "received args",args



		finishedClients = []

		finish = ->
			console.error "All clients finished. Wrapping up."

			report =
				testCount : results.testCount
				testsPassed : result.id for result in results.testsPassed
				testsFailed : result.id for result in results.testsFailed
				testsErrored : result.id for result in results.testsErrored


			console.error report2string report

			endTime = new Date()

			console.error "Running time: #{(endTime - startTime)/1000} seconds"

			#TODO: kill processes, then exit
			#serverClientComm.killClientProcesses()

			process.exit results.testCount == results.testsPassed

		console.error "starting server"
		server = http.createServer (request,response) ->
			url = urlModule.parse request.url
