 			if (operators['#'])
 				compileUnaryOperators(tokens, ['#']);
 			
-			// next step: compile infix '**' operators
+			// next step: compile statements
+			compileStatements(tokens);
+			
+			// next step: compile infix '**' operators
 			compileInfixOperators(tokens, ['**']);
-			
+			
 			// next step: compile unary operators
-			compileUnaryOperators(tokens, unaryOperatorSymbols);
-			
+			compileUnaryOperators(tokens, unaryOperatorSymbols);
+			
 			// next step: compile remaining infix operators in order
 			for (i = 0; i < orderedOperators.length; i++)
-				compileInfixOperators(tokens, orderedOperators[i]);
-			
+				compileInfixOperators(tokens, orderedOperators[i]);
+			
 			// next step: compile conditional branches
 			conditionals: while (true)
 			{

				if (leftBracket == '(' && compiledParams.length == 0)
					throw new Error("Missing expression inside parentheses");
				
				// if appropriate, simplify
				if (compiledParams.length == 1 && BRANCHES_REQUIRING_PARENTHESES.indexOf(token) < 0)
				{
					// simplify to single expression
					tokens.splice(open, 2, compiledParams[0]);
				}
				else
				{
					// multiple commands or branch construct
					tokens.splice(open, 2, compileOperator(separator, compiledParams));
				}
			}
		}

				}
				// treat everything else as a variable name.
				// make a copy of the variable name that is safe for the wrapper function to use
				// compile the token as a call to variableGetter.
				tokens[i] = compileVariable(token);
			}
			
