Index: gfanlib/gfanlib_polyhedralfan.cpp
===================================================================
--- gfanlib/gfanlib_polyhedralfan.cpp	(revision f6bfc4760c37e57e10254840047f2c962b9566bb)
+++ gfanlib/gfanlib_polyhedralfan.cpp	(revision e543ddddcd363bebd77251037f5f4c35de7e48ee)
@@ -308,7 +308,7 @@
    * which causes the ordering in which the different orbits appear to change.
    */
-
   if(cones.empty())return ZMatrix(0,n);
 ZMatrix generatorsOfLinealitySpace=cones.begin()->generatorsOfLinealitySpace();//all cones have the same lineality space
+
 
   std::set<ZVector> rays;//(this->getAmbientDimension());
@@ -317,5 +317,5 @@
     {
       ZMatrix temp=i->extremeRays(&generatorsOfLinealitySpace);
-      std::cerr<<temp;
+ //     std::cerr<<temp;
       for(int j=0;j<temp.getHeight();j++)
         rays.insert(symmetries.orbitRepresentative(temp[j]));
@@ -490,7 +490,5 @@
 
           ZMatrix generatorsOfLinealitySpace=cones.empty()?ZMatrix::identity(getAmbientDimension()):cones.begin()->generatorsOfLinealitySpace();
-          std::cerr<<generatorsOfLinealitySpace;
           SymmetricComplex symCom(rays,generatorsOfLinealitySpace,symmetries);
-
 
           for(PolyhedralConeList::const_iterator i=cones.begin();i!=cones.end();i++)
@@ -508,4 +506,5 @@
           symCom.remap();
 //          log1 cerr<<"Done remapping";
+
           return symCom;
 }
Index: gfanlib/gfanlib_symmetry.h
===================================================================
--- gfanlib/gfanlib_symmetry.h	(revision f6bfc4760c37e57e10254840047f2c962b9566bb)
+++ gfanlib/gfanlib_symmetry.h	(revision e543ddddcd363bebd77251037f5f4c35de7e48ee)
@@ -27,5 +27,5 @@
   static bool isPermutation(IntVector const &a);
   /**
-   * Returns true if all rows of the matrix are pemutations
+   * Returns true if all rows of the matrix contains the elements 0 up to m.getWidth()-1.
    */
   static bool arePermutations(IntMatrix const &m);
@@ -102,5 +102,4 @@
 
 class SymmetryGroup{
-//  unsigned char *byteTable;
   int byteTableHeight;
   class Trie *trie;
@@ -142,8 +141,5 @@
 
   // Methods for highly optimized symmetry group computations:
-//  void createByteTable();//Can only be called once. SymmetryGroup is not allowed to be changed afterwards or to be copied. Leaks memory at destruction.
   void createTrie();
-//  unsigned char *getByteTable()const;
-//  int getByteTableHeight()const;
 };
 /**
Index: gfanlib/gfanlib_zcone.cpp
===================================================================
--- gfanlib/gfanlib_zcone.cpp	(revision f6bfc4760c37e57e10254840047f2c962b9566bb)
+++ gfanlib/gfanlib_zcone.cpp	(revision e543ddddcd363bebd77251037f5f4c35de7e48ee)
@@ -413,5 +413,5 @@
         set_addelem(A->linset,i+1);
 
-      A->objective-dd_LPmax;
+      A->objective=dd_LPmax;
       lp=dd_Matrix2LP(A, &err);
       if (err!=dd_NoError) goto _L99;
@@ -717,5 +717,6 @@
       equations=QToZMatrixPrimitive(equations2);
     }
-  state=s;
+  if(state<s)
+    state=s;
 }
 
Index: gfanlib/gfanlib_zcone.h
===================================================================
--- gfanlib/gfanlib_zcone.h	(revision f6bfc4760c37e57e10254840047f2c962b9566bb)
+++ gfanlib/gfanlib_zcone.h	(revision e543ddddcd363bebd77251037f5f4c35de7e48ee)
@@ -90,4 +90,6 @@
 };
 
+class ZCone;
+ZCone intersection(const ZCone &a, const ZCone &b);
 class ZCone
 {
@@ -349,5 +351,5 @@
     friend std::ostream &operator<<(std::ostream &f, ZCone const &c);
 };
-ZCone intersection(const ZCone &a, const ZCone &b);
+
 };
 
Index: gfanlib/gfanlib_zfan.cpp
===================================================================
--- gfanlib/gfanlib_zfan.cpp	(revision f6bfc4760c37e57e10254840047f2c962b9566bb)
+++ gfanlib/gfanlib_zfan.cpp	(revision e543ddddcd363bebd77251037f5f4c35de7e48ee)
@@ -57,15 +57,19 @@
         assert(coneCollection);
         complex = new SymmetricComplex(coneCollection->toSymmetricComplex());
-        std::cerr<<"D"<<std::endl;
         complex->buildConeLists(false,false,&cones);
-        std::cerr<<"D"<<std::endl;
         complex->buildConeLists(true,false,&maximalCones);
-        std::cerr<<"D"<<std::endl;
         complex->buildConeLists(false,true,&coneOrbits);
-        std::cerr<<"D"<<std::endl;
         complex->buildConeLists(true,true,&maximalConeOrbits);
-        std::cerr<<"D"<<std::endl;
-      }
-  }
+      }
+  }
+  void ZFan::killComplex()const
+  {
+    if(complex)
+      {
+        delete complex;
+        complex=0;
+      }
+  }
+
   ZFan::ZFan(std::istream &f):
     coneCollection(0),
@@ -213,5 +217,4 @@
     if(this!=&f)
       {
-std::cerr<<"COPYING\n";
         if(complex)
           {
@@ -219,5 +222,4 @@
             complex=0;
           }
-        std::cerr<<"1COPYING\n";
         if(coneCollection)
           {
@@ -225,15 +227,12 @@
             coneCollection=0;
           }
-        std::cerr<<"2COPYING\n";
         if(f.coneCollection)
           {
             coneCollection=new PolyhedralFan(*f.coneCollection);
           }
-        std::cerr<<"3COPYING\n";
         if(f.complex)
           {
             complex=new SymmetricComplex(*f.complex);
           }
-        std::cerr<<"DONE COPYING\n";
       }
     return *this;
@@ -273,4 +272,5 @@
   {
     ensureConeCollection();
+    killComplex();
     coneCollection->insert(c);
   }
@@ -291,4 +291,8 @@
 {
   ensureComplex();
+
+  //  std::string s=complex->toString(flags);
+//  killComplex();
+//  return s;//complex->getMinDim(),complex->getMaxDim(),0,0);
   return complex->toString(flags);//complex->getMinDim(),complex->getMaxDim(),0,0);
 //  return "NEEDTOFIXTHIS";
Index: gfanlib/gfanlib_zfan.h
===================================================================
--- gfanlib/gfanlib_zfan.h	(revision f6bfc4760c37e57e10254840047f2c962b9566bb)
+++ gfanlib/gfanlib_zfan.h	(revision e543ddddcd363bebd77251037f5f4c35de7e48ee)
@@ -58,4 +58,5 @@
   void ensureConeCollection()const;
   void ensureComplex()const;
+  void killComplex()const;
   std::vector<std::vector<IntVector> > &table(bool orbit, bool maximal)const;
 public:
