 		tempAddClass "#check_button", "button_red"
 		diagram.mistakes += 1
 
+
 onDoneButtonClick = (e) ->
 	if diagram.unfound_tuples.length == 0
-		startNextDiagram
+		startNextDiagram()
 		tempAddClass "#done_button", "button_green"
 	else
 		tempAddClass "#done_button", "button_red"
 		diagram.mistakes += 1
-
-
+# }}}
+# Top-level game management {{{
 startNextDiagram = () ->
+	alert("Good job")
 	console.log("Next diagram")
-
 # }}}
 # Start Game {{{
+
 startGame = () ->
 	CANVAS = $("<canvas></canvas>")
 	CANVAS.attr "height", CANVAS_HEIGHT


onCheckButtonClick = (e) ->
	clone = active_points.slice(0) # I hate JS
	stringifiedActive = JSON.stringify( (p.toString() for p in pointSort(clone)) )
	if stringifiedActive in diagram.unfound_tuples
		# Good job, delete it
		$("#found").append($("<li>" + active_points.toString() + "</li>"))


# Main function {{{
$ ->
	enableButtonIf("#check_button", false)
	enableButtonIf("#done_button", false)
	$("#start_game").click startGame

# }}}
