 
 			return outVariables
 
+		replaceVariables: (replacements) ->
+			for child, index in @children
+				if child instanceof terminals.Variable and child.label of replacements
+					@children[index] = replacements[child.label]
+
 		sub: (substitutions) ->
 			# subtitutions: {variable: value}
 			# variable is a label, value is any object - if it is a node,


			return outVariables

		toMathML: (equationID, expression=false, equality="0", topLevel=false) ->
			# Return a MathML string representing this node.
			# This code was partially lifted from the (delightfully uncommented) predecessor


			return outVariables

		replaceVariables: (replacements) ->
			for child, index in @children
				if child instanceof terminals.Variable and child.label of replacements
					@children[index] = replacements[child.label]

		sub: (substitutions) ->
			# subtitutions: {variable: value}
			# variable is a label, value is any object - if it is a node,
