 
 			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

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


			return outVariables

		replaceVariables: (replacements) ->
			# {variableLabel: replacementLabel}
			if @children.left instanceof terminals.Variable and @children.left.label of replacements
				@children.left.label = replacements[@children.left.label]
			if @children.right instanceof terminals.Variable and @children.right.label of replacements
				@children.right.label = replacements[@children.right.label]

		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
