 	# Generates a pseudorandom sequence (word) using the given model.
 generate = (maxLength, model, n=3) ->
 		# Pseudorandomly picks an element from containingObject with respect
-		# to each element's frequency property.
+		# to each element's frequency property.  If containingObject has no
+		# elements, returns null.
 	pickElement = (containingObject) ->
 		target = Math.random()
 		sum = 0.0

	maxLength = 8
	currentModel = null
	
	capitalize = (string) -> string[0].toUpperCase() + string.slice(1)
	
	generateAndShow = ->
		$word.text capitalize generate maxLength, currentModel, n

			sum += element.frequency
			if sum >= target then return elementName
	
		# Returns the node of the probability tree (generate()'s "model" argument)
		# that represents the supplied sequence.  If no such node exists,
		# returns null.
	node = (sequence) ->
