diff --git a/NumericalInitialization.cc b/NumericalInitialization.cc
index c1e36a513be8060b01a8bb06b5663a56ebd33fa0..b7783141e8130aff7eb084b091d5c9e3967f3cbf 100644
--- a/NumericalInitialization.cc
+++ b/NumericalInitialization.cc
@@ -154,7 +154,7 @@ HistValStatement::writeOutput(ostream &output, const string &basename) const
 }
 
 HomotopyStatement::HomotopyStatement(const homotopy_values_type &homotopy_values_arg,
-                                   const SymbolTable &symbol_table_arg) :
+                                     const SymbolTable &symbol_table_arg) :
   homotopy_values(homotopy_values_arg),
   symbol_table(symbol_table_arg)
 {
@@ -163,11 +163,10 @@ HomotopyStatement::HomotopyStatement(const homotopy_values_type &homotopy_values
 void
 HomotopyStatement::writeOutput(ostream &output, const string &basename) const
 {
-  output << interfaces::comment() << "\n" << interfaces::comment() << "HOMOTOPY_SETUP instructions\n"
-         << interfaces::comment() << "\n";
-  output << "homotopy_param = {};" << endl; 
-  output << "homotopy_exo = {};" << endl; 
-  output << "homotopy_exodet = {};" << endl; 
+  output << interfaces::comment() << endl
+         << interfaces::comment() << "HOMOTOPY_SETUP instructions" << endl
+         << interfaces::comment() << endl
+         << "options_.homotopy_values = [];" << endl;
 
   for(homotopy_values_type::const_iterator it = homotopy_values.begin();
       it != homotopy_values.end(); it++)
@@ -176,24 +175,13 @@ HomotopyStatement::writeOutput(ostream &output, const string &basename) const
       const NodeID expression1 = it->second.first;
       const NodeID expression2 = it->second.second;
 
-      Type type = symbol_table.getType(name);
+      const Type type = symbol_table.getType(name);
+      const int id = symbol_table.getID(name) + 1;
 
-      if (type == eParameter)
-        output << "homotopy_param = vertcat(homotopy_param,{ '" << name << "', ";
-      else if (type == eExogenous)
-        output << "homotopy_exo = vertcat(homotopy_exo,{ '" << name << "', ";
-      else if (type != eExogenousDet)
-        output << "homotopy_exodet = vertcat(homotopy_exodet,{ '" << name << "', ";
-
-        
+      output << "options_.homotopy_values = vertcat(options_.homotopy_values, [ " << type << ", " << id << ", ";
       expression1->writeOutput(output);
       output << ", ";
       expression2->writeOutput(output);
-      output << "});" << endl;
+      output << "]);" << endl;
     }
-  
-  output << "options_.homotopy_param = homotopy_param;" << endl;
-  output << "options_.homotopy_exo = homotopy_exo;" << endl;
-  output << "options_.homotopy_exodet = homotopy_exodet;" << endl;
 }
-
diff --git a/ParsingDriver.cc b/ParsingDriver.cc
index 272ebab768c3b3608f6fbeae3dfcc5716e299713..eec83386b03ce380ba4e9d160588cb1db1f0382d 100644
--- a/ParsingDriver.cc
+++ b/ParsingDriver.cc
@@ -350,8 +350,7 @@ ParsingDriver::homotopy_val(string *name, NodeID val1, NodeID val2)
   if (homotopy_values.find(*name) != homotopy_values.end())
     error("homotopy_val: " + *name +" declared twice");
 
-  pair<NodeID, NodeID> expressions(val1, val2);
-  homotopy_values[*name] = expressions;
+  homotopy_values[*name] = make_pair(val1, val2);
 
   delete name;
 }
diff --git a/include/CodeInterpreter.hh b/include/CodeInterpreter.hh
index 237d577f1b7c534b100dfb125b2bdb72943ae735..4c3df3479bf1746f2a83367225b4fdbd74042210 100644
--- a/include/CodeInterpreter.hh
+++ b/include/CodeInterpreter.hh
@@ -58,7 +58,7 @@ const int EVALUATE_FOREWARD_R=8;
 const int EVALUATE_BACKWARD_R=9;
 
 //! Enumeration of possible symbol types
-/*! Warning: do not to change the order of the enumeration, it matters for VariableTable (at least ensure that eEndogenous is the first one) */
+/*! Warning: do not to change existing values: the order matters for VariableTable (at least ensure that eEndogenous is the first one), and the values matter for homotopy_setup command */
 enum Type
   {
     eEndogenous = 0,               //!< Endogenous
diff --git a/include/NumericalInitialization.hh b/include/NumericalInitialization.hh
index 1dfcdab547f5de56293f2e8b6353609344da74c0..f920c96756df6553ec6da7a70808361b102f65be 100644
--- a/include/NumericalInitialization.hh
+++ b/include/NumericalInitialization.hh
@@ -105,7 +105,7 @@ private:
   const SymbolTable &symbol_table;
 public:
   HomotopyStatement(const homotopy_values_type &homotopy_values_arg,
-		    const SymbolTable &symbol_table_arg);
+                    const SymbolTable &symbol_table_arg);
   virtual void writeOutput(ostream &output, const string &basename) const;
 };
 #endif