      ++
      subroutine_body
      ++
-     ["  </subroutineDec>"], rest2}
-  end
-
-  def parse([{_, x} | rest]) do
-    {["<other> #{x} <other>"], rest}
-  end
-
-  def parse([]), do: {[], []}
+     ["  </subroutineDec>"] ++ more, rest3}
+  end
+
+  def parse_subroutines([{:symbol, "}"} | rest]), do: {[], rest}
 
   def parse_parameter_list([{:symbol, "("} | rest]) do
     {params, rest1} = parse_parameters(rest)


  def parse_statement([{:keyword, "return"}
                       | rest]) do
    {exp, rest1} = parse_expression(rest)
    {statement, rest2} = parse_statement(rest1)
    {["        <returnStatement>",
      "          <keyword> return </keyword>",
      "          <symbol> ; </symbol>",
      "        </returnStatement>"] ++ statement, rest2}
  end

  def parse_expression([{:identifier, x} | rest]) do
    {["          <expression>",
      "            <term>",
      "              <identifier> #{x} </identifier>",
      "            </term>",
      "          </expression>"], rest}
  end
  
  def parse_subroutine_call([{:identifier, subroutine_name},
                             {:symbol, "("}

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

  def parse_subroutine_call([{:identifier, class_or_var_name},
