 
   def parse_statement([{:keyword, "return"}
                        | rest]) do
-    {exp, rest1} = parse_expression(rest)
-    {statement, rest2} = parse_statement(rest1)
+    {expression, rest1} = parse_expression(rest)
+    [{:symbol, ";"} | rest2] = rest1
+    {statement, rest3} = parse_statement(rest2)
     {["        <returnStatement>",
-      "          <keyword> return </keyword>",
-      "          <symbol> ; </symbol>",
-      "        </returnStatement>"] ++ statement, rest2}
+      "          <keyword> return </keyword>"]
+     ++
+     expression
+     ++
+     ["          <symbol> ; </symbol>",
+      "        </returnStatement>"]
+     ++ statement, rest3}
   end
 
   def parse_expression([{:identifier, x} | rest]) do
+    {more, rest1} = parse_expression(rest)
     {["          <expression>",
       "            <term>",
       "              <identifier> #{x} </identifier>",
       "            </term>",
-      "          </expression>"], rest}
-  end
+      "          </expression>"] ++ more, rest1}
+  end
+
+  def parse_expression([{:symbol, ","} | rest]) do
+    {exp, rest1} = parse_expression(rest)
+    {["          <symbol> , </symbol>"] ++ exp, rest1}
+  end
+
+  def parse_expression(all), do: {[], all}
   
   def parse_subroutine_call([{:identifier, subroutine_name},
                              {:symbol, "("}

      "        </letStatement>"] ++ statement, rest1}
  end

  def parse_statement([{:keyword, "if"} | rest]) do
    []
  end

  def parse_statement([{:keyword, "while"} | rest]) do
    []
  end

  def parse_statement([{:keyword, "do"} | rest]) do
    {subroutine_call, rest1} = parse_subroutine_call(rest)
    {statement, rest2} = parse_statement(rest1)
    {["        <doStatement>",
      "          <keyword> do </keyword>"]
     ++
     subroutine_call
     ++
     ["        </doStatement>"] ++ statement, rest2}
  end

  def parse_statement([{:keyword, "return"},

     ++
     exp_list
     ++
     ["          <symbol> ) </symbol>"], rest1}
  end

  def parse_expression_list([{:symbol, ")"} | rest]) do
    {["          <expressionList>",
      "          </expressionList>"], rest}
  end

  def parse_expression_list(all) do
    {exp, rest} = parse_expression(all)
    [{:symbol, ")"} | rest1] = rest
    {["          <expressionList>"]
     ++
     exp
     ++
     ["          </expressionList>"], rest1}
  end

  def parse_else_statements([{:keyword, "else"},
                             {:symbol, "{"} | rest]) do
    {statements, rest1} = parse_statements(rest)
    [{:symbol, "}"} | rest2] = rest1
    {["          <keyword> else </keyword>",
      "          <symbol> { </symbol>"]
     ++ statements
     ++
     ["          <symbol> } </symbol>"], rest2}
  end

  def parse_else_statements(all), do: {[], all}
  
end
