Index: src/include/invalid.h
===================================================================
--- src/include/invalid.h	(revision 253)
+++ src/include/invalid.h	(revision 389)
@@ -28,5 +28,5 @@
   const Invalid INVALID = Invalid();
 
-};
+} //namespace hugo
 
 #endif
Index: src/include/maps.h
===================================================================
--- src/include/maps.h	(revision 346)
+++ src/include/maps.h	(revision 389)
@@ -93,5 +93,7 @@
     
     template<typename T1, typename Comp1>
-    StdMap(const StdMap<Key,T1,Comp1> &m, const T &_v) { FIXME; }
+    StdMap(const StdMap<Key,T1,Comp1> &m, const T &_v) { 
+      //FIXME; 
+    }
 
     ReferenceType operator[](const Key &k) {
@@ -99,5 +101,6 @@
     }
     ConstReferenceType operator[](const Key &k) const {
-      typename parent::iterator i = lower_bound(__k);
+//marci jav      typename parent::iterator i = lower_bound(__k);
+      typename parent::iterator i = lower_bound(k);
       if (i == end() || key_comp()(k, (*i).first))
 	return v;
Index: src/work/jacint/preflow.h
===================================================================
--- src/work/jacint/preflow.h	(revision 372)
+++ src/work/jacint/preflow.h	(revision 389)
@@ -53,6 +53,6 @@
 
   template <typename Graph, typename T, 
-	    typename CapMap=typename Graph::EdgeMap<T>, 
-            typename FlowMap=typename Graph::EdgeMap<T> >
+	    typename CapMap=typename Graph::template EdgeMap<T>, 
+            typename FlowMap=typename Graph::template EdgeMap<T> >
   class Preflow {
     
@@ -100,14 +100,14 @@
       int b=k;    //bound on the highest level under n of an active node
       
-      typename Graph::NodeMap<int> level(G,n);      
-      typename Graph::NodeMap<T> excess(G); 
+      typename Graph::template NodeMap<int> level(G,n);      
+      typename Graph::template NodeMap<T> excess(G); 
 
       std::vector<Node> active(n-1,INVALID);
-      typename Graph::NodeMap<Node> next(G,INVALID);
+      typename Graph::template NodeMap<Node> next(G,INVALID);
       //Stack of the active nodes in level i < n.
       //We use it in both phases.
 
-      typename Graph::NodeMap<Node> left(G,INVALID);
-      typename Graph::NodeMap<Node> right(G,INVALID);
+      typename Graph::template NodeMap<Node> left(G,INVALID);
+      typename Graph::template NodeMap<Node> right(G,INVALID);
       std::vector<Node> level_list(n,INVALID);
       /*
Index: src/work/list_graph.h
===================================================================
--- src/work/list_graph.h	(revision 368)
+++ src/work/list_graph.h	(revision 389)
@@ -30,5 +30,5 @@
     template <typename T> class NodeMap;
     template <typename T> class EdgeMap;
-  private:
+//  private:
     template <typename T> friend class NodeMap;
     template <typename T> friend class EdgeMap;
@@ -76,4 +76,5 @@
     };
 
+  private:
     int node_id;
     int edge_id;
Index: src/work/makefile
===================================================================
--- src/work/makefile	(revision 347)
+++ src/work/makefile	(revision 389)
@@ -1,4 +1,4 @@
 INCLUDEDIRS ?= -I../include -I. -I./{marci,jacint,alpar,klao,akos}
-CXXFLAGS = -g -O -Wall $(INCLUDEDIRS) -ansi -pedantic
+CXXFLAGS = -g -O2 -W -Wall $(INCLUDEDIRS) -ansi -pedantic
 
 BINARIES ?= bin_heap_demo
@@ -6,4 +6,5 @@
 # Hat, ez elismerem, hogy nagyon ronda, de mukodik minden altalam
 # ismert rendszeren :-)  (Misi)
+#CXX := $(shell type -p g++-3.4 || type -p g++-3.3 || type -p g++-3.2 || type -p g++-3.0 || type -p g++-3 || echo g++)
 CXX := $(shell type -p g++-3.3 || type -p g++-3.2 || type -p g++-3.0 || type -p g++-3 || echo g++)
 CC := $(CXX)
Index: src/work/marci/bfs_iterator.h
===================================================================
--- src/work/marci/bfs_iterator.h	(revision 360)
+++ src/work/marci/bfs_iterator.h	(revision 389)
@@ -147,5 +147,5 @@
     bool isANodeExamined() const { return !(graph->valid(actual_edge)); }
     Node aNode() const { return actual_node; /*FIXME*/}
-    Node bNode() const { return G.bNode(actual_edge); }
+    Node bNode() const { return graph->bNode(actual_edge); }
     const ReachedMap& getReachedMap() const { return reached; }
     const std::stack<OutEdgeIt>& getDfsStack() const { return dfs_stack; }
Index: src/work/marci/bfsit_vs_byhand.cc
===================================================================
--- src/work/marci/bfsit_vs_byhand.cc	(revision 360)
+++ src/work/marci/bfsit_vs_byhand.cc	(revision 389)
@@ -4,5 +4,5 @@
 
 #include <list_graph.h>
-#include <smart_graph.h>
+//#include <smart_graph.h>
 #include <dimacs.h>
 #include <time_measure.h>
Index: src/work/marci/bipartite_graph_wrapper_test.cc
===================================================================
--- src/work/marci/bipartite_graph_wrapper_test.cc	(revision 379)
+++ src/work/marci/bipartite_graph_wrapper_test.cc	(revision 389)
@@ -5,5 +5,5 @@
 
 #include <list_graph.h>
-#include <smart_graph.h>
+//#include <smart_graph.h>
 //#include <dimacs.h>
 #include <time_measure.h>
Index: src/work/marci/edmonds_karp.h
===================================================================
--- src/work/marci/edmonds_karp.h	(revision 360)
+++ src/work/marci/edmonds_karp.h	(revision 389)
@@ -276,11 +276,12 @@
       bool _augment=false;
       
-      BfsIterator< ResGW, typename ResGW::NodeMap<bool> > bfs(res_graph);
+      BfsIterator< ResGW, typename ResGW::template NodeMap<bool> > 
+	bfs(res_graph);
       bfs.pushAndSetReached(s);
 	
-      typename ResGW::NodeMap<ResGWEdge> pred(res_graph); 
+      typename ResGW::template NodeMap<ResGWEdge> pred(res_graph); 
       pred.set(s, INVALID);
       
-      typename ResGW::NodeMap<Number> free(res_graph);
+      typename ResGW::template NodeMap<Number> free(res_graph);
 	
       //searching for augmenting path
@@ -319,5 +320,5 @@
     protected:
       const MapGraphWrapper* g;
-      typename MapGraphWrapper::NodeMap<int> dist; 
+      typename MapGraphWrapper::template NodeMap<int> dist; 
     public:
       DistanceMap(MapGraphWrapper& _g) : g(&_g), dist(*g, g->nodeNum()) { }
@@ -340,5 +341,6 @@
       ResGW res_graph(*g, *capacity, *flow);
 
-      BfsIterator< ResGW, typename ResGW::NodeMap<bool> > bfs(res_graph);
+      BfsIterator< ResGW, typename ResGW::template NodeMap<bool> > 
+	bfs(res_graph);
 
       bfs.pushAndSetReached(s);
@@ -358,5 +360,6 @@
 	DistanceMap<ResGW> > FilterResGW;
       FilterResGW filter_res_graph(res_graph, true_map, dist);
-      typename ResGW::NodeMap<typename MG::Node> res_graph_to_F(res_graph);
+      typename ResGW::template NodeMap<typename MG::Node> 
+	res_graph_to_F(res_graph);
       {
 	typename ResGW::NodeIt n;
@@ -368,6 +371,6 @@
       typename MG::Node sF=res_graph_to_F[s];
       typename MG::Node tF=res_graph_to_F[t];
-      typename MG::EdgeMap<ResGWEdge> original_edge(F);
-      typename MG::EdgeMap<Number> residual_capacity(F);
+      typename MG::template EdgeMap<ResGWEdge> original_edge(F);
+      typename MG::template EdgeMap<Number> residual_capacity(F);
 
       //Making F to the graph containing the edges of the residual graph 
@@ -392,10 +395,10 @@
 	//computing blocking flow with dfs
 
-	DfsIterator< MG, typename MG::NodeMap<bool> > dfs(F);
-	typename MG::NodeMap<typename MG::Edge> pred(F);
+	DfsIterator< MG, typename MG::template NodeMap<bool> > dfs(F);
+	typename MG::template NodeMap<typename MG::Edge> pred(F);
 	pred.set(sF, INVALID);
 	//invalid iterators for sources
 
-	typename MG::NodeMap<Number> free(F);
+	typename MG::template NodeMap<Number> free(F);
 
 	dfs.pushAndSetReached(sF);      
@@ -450,12 +453,15 @@
 
       //bfs for distances on the residual graph
-      BfsIterator< ResGW, typename ResGW::NodeMap<bool> > bfs(res_graph);
+      BfsIterator< ResGW, typename ResGW::template NodeMap<bool> > 
+	bfs(res_graph);
       bfs.pushAndSetReached(s);
-      typename ResGW::NodeMap<int> dist(res_graph); //filled up with 0's
+      typename ResGW::template NodeMap<int> 
+	dist(res_graph); //filled up with 0's
 
       //F will contain the physical copy of the residual graph
       //with the set of edges which are on shortest paths
       MG F;
-      typename ResGW::NodeMap<typename MG::Node> res_graph_to_F(res_graph);
+      typename ResGW::template NodeMap<typename MG::Node> 
+	res_graph_to_F(res_graph);
       {
 	typename ResGW::NodeIt n;
@@ -467,6 +473,6 @@
       typename MG::Node sF=res_graph_to_F[s];
       typename MG::Node tF=res_graph_to_F[t];
-      typename MG::EdgeMap<ResGWEdge> original_edge(F);
-      typename MG::EdgeMap<Number> residual_capacity(F);
+      typename MG::template EdgeMap<ResGWEdge> original_edge(F);
+      typename MG::template EdgeMap<Number> residual_capacity(F);
 
       while ( !bfs.finished() ) { 
@@ -498,10 +504,10 @@
 	__augment=false;
 	//computing blocking flow with dfs
-	DfsIterator< MG, typename MG::NodeMap<bool> > dfs(F);
-	typename MG::NodeMap<typename MG::Edge> pred(F);
+	DfsIterator< MG, typename MG::template NodeMap<bool> > dfs(F);
+	typename MG::template NodeMap<typename MG::Edge> pred(F);
 	pred.set(sF, INVALID);
 	//invalid iterators for sources
 
-	typename MG::NodeMap<Number> free(F);
+	typename MG::template NodeMap<Number> free(F);
 
 	dfs.pushAndSetReached(sF);      
@@ -554,5 +560,6 @@
       ResGW res_graph(*g, *capacity, *flow);
 
-      BfsIterator< ResGW, typename ResGW::NodeMap<bool> > bfs(res_graph);
+      BfsIterator< ResGW, typename ResGW::template NodeMap<bool> > 
+	bfs(res_graph);
 
       bfs.pushAndSetReached(s);
@@ -574,5 +581,5 @@
       //Subgraph, which is able to delete edges which are already 
       //met by the dfs
-      typename FilterResGW::NodeMap<typename FilterResGW::OutEdgeIt> 
+      typename FilterResGW::template NodeMap<typename FilterResGW::OutEdgeIt> 
  	first_out_edges(filter_res_graph);
       typename FilterResGW::NodeIt v;
@@ -585,5 +592,5 @@
       }
       typedef ErasingFirstGraphWrapper<FilterResGW, typename FilterResGW::
-	NodeMap<typename FilterResGW::OutEdgeIt> > ErasingResGW;
+	template NodeMap<typename FilterResGW::OutEdgeIt> > ErasingResGW;
       ErasingResGW erasing_res_graph(filter_res_graph, first_out_edges);
 
@@ -594,12 +601,15 @@
  	__augment=false;
   	//computing blocking flow with dfs
-  	DfsIterator< ErasingResGW, typename ErasingResGW::NodeMap<bool> > 
+  	DfsIterator< ErasingResGW, 
+	  typename ErasingResGW::template NodeMap<bool> > 
   	  dfs(erasing_res_graph);
- 	typename ErasingResGW::NodeMap<typename ErasingResGW::OutEdgeIt> 
- 	  pred(erasing_res_graph); 
+ 	typename ErasingResGW::
+	  template NodeMap<typename ErasingResGW::OutEdgeIt> 
+	  pred(erasing_res_graph); 
  	pred.set(s, INVALID);
   	//invalid iterators for sources
 
-  	typename ErasingResGW::NodeMap<Number> free1(erasing_res_graph);
+  	typename ErasingResGW::template NodeMap<Number> 
+	  free1(erasing_res_graph);
 
  	dfs.pushAndSetReached(
Index: src/work/marci/edmonds_karp_demo.cc
===================================================================
--- src/work/marci/edmonds_karp_demo.cc	(revision 376)
+++ src/work/marci/edmonds_karp_demo.cc	(revision 389)
@@ -4,5 +4,5 @@
 
 #include <list_graph.h>
-#include <smart_graph.h>
+//#include <smart_graph.h>
 #include <dimacs.h>
 #include <edmonds_karp.h>
Index: src/work/marci/graph_wrapper.h
===================================================================
--- src/work/marci/graph_wrapper.h	(revision 381)
+++ src/work/marci/graph_wrapper.h	(revision 389)
@@ -184,18 +184,16 @@
     void clear() const { graph->clear(); }
     
-    template<typename T> class NodeMap : public Graph::NodeMap<T> { 
-    public:
-      NodeMap(const GraphWrapper<Graph>& _G) :  
-	Graph::NodeMap<T>(*(_G.graph)) { }
-      NodeMap(const GraphWrapper<Graph>& _G, T a) : 
-	Graph::NodeMap<T>(*(_G.graph), a) { }
-    };
-
-    template<typename T> class EdgeMap : public Graph::EdgeMap<T> { 
-    public:
-      EdgeMap(const GraphWrapper<Graph>& _G) :  
-	Graph::EdgeMap<T>(*(_G.graph)) { }
-      EdgeMap(const GraphWrapper<Graph>& _G, T a) : 
-	Graph::EdgeMap<T>(*(_G.graph), a) { }
+    template<typename T> class NodeMap : public Graph::template NodeMap<T> { 
+      typedef typename Graph::template NodeMap<T> Parent;
+    public:
+      NodeMap(const GraphWrapper<Graph>& _G) :  Parent(*(_G.graph)) { }
+      NodeMap(const GraphWrapper<Graph>& _G, T a) : Parent(*(_G.graph), a) { }
+    };
+
+    template<typename T> class EdgeMap : public Graph::template EdgeMap<T> { 
+      typedef typename Graph::template EdgeMap<T> Parent;
+    public:
+      EdgeMap(const GraphWrapper<Graph>& _G) : Parent(*(_G.graph)) { }
+      EdgeMap(const GraphWrapper<Graph>& _G, T a) : Parent(*(_G.graph), a) { }
     };
   };
@@ -253,11 +251,15 @@
 
     using GraphWrapper<Graph>::next;
-    OutEdgeIt& next(OutEdgeIt& i) const { graph->next(i.e); return i; }
-    InEdgeIt& next(InEdgeIt& i) const { graph->next(i.e); return i; }
-
-    Node aNode(const OutEdgeIt& e) const { return Node(graph->aNode(e.e)); }
-    Node aNode(const InEdgeIt& e) const { return Node(graph->aNode(e.e)); }
-    Node bNode(const OutEdgeIt& e) const { return Node(graph->bNode(e.e)); }
-    Node bNode(const InEdgeIt& e) const { return Node(graph->bNode(e.e)); }
+    OutEdgeIt& next(OutEdgeIt& i) const { this->graph->next(i.e); return i; }
+    InEdgeIt& next(InEdgeIt& i) const { this->graph->next(i.e); return i; }
+
+    Node aNode(const OutEdgeIt& e) const { 
+      return Node(this->graph->aNode(e.e)); }
+    Node aNode(const InEdgeIt& e) const { 
+      return Node(this->graph->aNode(e.e)); }
+    Node bNode(const OutEdgeIt& e) const { 
+      return Node(this->graph->bNode(e.e)); }
+    Node bNode(const InEdgeIt& e) const { 
+      return Node(this->graph->bNode(e.e)); }
 
     Node tail(const Edge& e) const { 
@@ -367,28 +369,36 @@
     
     NodeIt& next(NodeIt& i) const {
-      graph->next(i.n); 
-      while (graph->valid(i) && !(*node_filter_map)[i.n]) { graph->next(i.n); }
+      this->graph->next(i.n); 
+      while (this->graph->valid(i) && !(*node_filter_map)[i.n]) { 
+	this->graph->next(i.n); }
       return i;
     }
     OutEdgeIt& next(OutEdgeIt& i) const {
-      graph->next(i.e); 
-      while (graph->valid(i) && !(*edge_filter_map)[i.e]) { graph->next(i.e); }
+      this->graph->next(i.e); 
+      while (this->graph->valid(i) && !(*edge_filter_map)[i.e]) { 
+	this->graph->next(i.e); }
       return i;
     }
     InEdgeIt& next(InEdgeIt& i) const {
-      graph->next(i.e); 
-      while (graph->valid(i) && !(*edge_filter_map)[i.e]) { graph->next(i.e); }
+      this->graph->next(i.e); 
+      while (this->graph->valid(i) && !(*edge_filter_map)[i.e]) { 
+	this->graph->next(i.e); }
       return i;
     }
     EdgeIt& next(EdgeIt& i) const {
-      graph->next(i.e); 
-      while (graph->valid(i) && !(*edge_filter_map)[i.e]) { graph->next(i.e); }
+      this->graph->next(i.e); 
+      while (this->graph->valid(i) && !(*edge_filter_map)[i.e]) { 
+	this->graph->next(i.e); }
       return i;
     }
 
-    Node aNode(const OutEdgeIt& e) const { return Node(graph->aNode(e.e)); }
-    Node aNode(const InEdgeIt& e) const { return Node(graph->aNode(e.e)); }
-    Node bNode(const OutEdgeIt& e) const { return Node(graph->bNode(e.e)); }
-    Node bNode(const InEdgeIt& e) const { return Node(graph->bNode(e.e)); }
+    Node aNode(const OutEdgeIt& e) const { 
+      return Node(this->graph->aNode(e.e)); }
+    Node aNode(const InEdgeIt& e) const { 
+      return Node(this->graph->aNode(e.e)); }
+    Node bNode(const OutEdgeIt& e) const { 
+      return Node(this->graph->bNode(e.e)); }
+    Node bNode(const InEdgeIt& e) const { 
+      return Node(this->graph->bNode(e.e)); }
 
     ///\todo
@@ -470,9 +480,10 @@
     OutEdgeIt& next(OutEdgeIt& e) const {
       if (e.out_or_in) {
-	typename Graph::Node n=graph->tail(e.out);
-	graph->next(e.out);
-	if (!graph->valid(e.out)) { e.out_or_in=false; graph->first(e.in, n); }
+	typename Graph::Node n=this->graph->tail(e.out);
+	this->graph->next(e.out);
+	if (!this->graph->valid(e.out)) { 
+	  e.out_or_in=false; this->graph->first(e.in, n); }
       } else {
-	graph->next(e.in);
+	this->graph->next(e.in);
       }
       return e;
@@ -486,7 +497,9 @@
 
     Node aNode(const OutEdgeIt& e) const { 
-      if (e.out_or_in) return graph->tail(e); else return graph->head(e); }
+      if (e.out_or_in) return this->graph->tail(e); else 
+	return this->graph->head(e); }
     Node bNode(const OutEdgeIt& e) const { 
-      if (e.out_or_in) return graph->head(e); else return graph->tail(e); }
+      if (e.out_or_in) return this->graph->head(e); else 
+	return this->graph->tail(e); }
   };
   
@@ -646,15 +659,18 @@
     OutEdgeIt& next(OutEdgeIt& e) const { 
       if (e.forward) {
-	Node v=graph->aNode(e.out);
-	graph->next(e.out);
-	while( graph->valid(e.out) && !(resCap(e)>0) ) { graph->next(e.out); }
-	if (!graph->valid(e.out)) {
+	Node v=this->graph->aNode(e.out);
+	this->graph->next(e.out);
+	while( this->graph->valid(e.out) && !(resCap(e)>0) ) { 
+	  this->graph->next(e.out); }
+	if (!this->graph->valid(e.out)) {
 	  e.forward=false;
-	  graph->first(e.in, v); 
-	  while( graph->valid(e.in) && !(resCap(e)>0) ) { graph->next(e.in); }
+	  this->graph->first(e.in, v); 
+	  while( this->graph->valid(e.in) && !(resCap(e)>0) ) { 
+	    this->graph->next(e.in); }
 	}
       } else {
-	graph->next(e.in);
-	while( graph->valid(e.in) && !(resCap(e)>0) ) { graph->next(e.in); } 
+	this->graph->next(e.in);
+	while( this->graph->valid(e.in) && !(resCap(e)>0) ) { 
+	  this->graph->next(e.in); } 
       }
       return e;
@@ -663,15 +679,18 @@
     InEdgeIt& next(InEdgeIt& e) const { 
       if (e.forward) {
-	Node v=graph->aNode(e.in);
-	graph->next(e.in);
-	while( graph->valid(e.in) && !(resCap(e)>0) ) { graph->next(e.in); }
-	if (!graph->valid(e.in)) {
+	Node v=this->graph->aNode(e.in);
+	this->graph->next(e.in);
+	while( this->graph->valid(e.in) && !(resCap(e)>0) ) { 
+	  this->graph->next(e.in); }
+	if (!this->graph->valid(e.in)) {
 	  e.forward=false;
-	  graph->first(e.out, v); 
-	  while( graph->valid(e.out) && !(resCap(e)>0) ) { graph->next(e.out); }
+	  this->graph->first(e.out, v); 
+	  while( this->graph->valid(e.out) && !(resCap(e)>0) ) { 
+	    this->graph->next(e.out); }
 	}
       } else {
-	graph->next(e.out);
-	while( graph->valid(e.out) && !(resCap(e)>0) ) { graph->next(e.out); } 
+	this->graph->next(e.out);
+	while( this->graph->valid(e.out) && !(resCap(e)>0) ) { 
+	  this->graph->next(e.out); } 
       }
       return e;
@@ -679,14 +698,17 @@
     EdgeIt& next(EdgeIt& e) const {
       if (e.forward) {
-	graph->next(e.e);
-	while( graph->valid(e.e) && !(resCap(e)>0) ) { graph->next(e.e); }
-	if (!graph->valid(e.e)) {
+	this->graph->next(e.e);
+	while( this->graph->valid(e.e) && !(resCap(e)>0) ) { 
+	  this->graph->next(e.e); }
+	if (!this->graph->valid(e.e)) {
 	  e.forward=false;
-	  graph->first(e.e); 
-	  while( graph->valid(e.e) && !(resCap(e)>0) ) { graph->next(e.e); }
+	  this->graph->first(e.e); 
+	  while( this->graph->valid(e.e) && !(resCap(e)>0) ) { 
+	    this->graph->next(e.e); }
 	}
       } else {
-	graph->next(e.e);
-	while( graph->valid(e.e) && !(resCap(e)>0) ) { graph->next(e.e); } 
+	this->graph->next(e.e);
+	while( this->graph->valid(e.e) && !(resCap(e)>0) ) { 
+	  this->graph->next(e.e); } 
       }
       return e;
@@ -694,17 +716,21 @@
 
     Node tail(Edge e) const { 
-      return ((e.forward) ? graph->tail(e) : graph->head(e)); }
+      return ((e.forward) ? this->graph->tail(e) : this->graph->head(e)); }
     Node head(Edge e) const { 
-      return ((e.forward) ? graph->head(e) : graph->tail(e)); }
+      return ((e.forward) ? this->graph->head(e) : this->graph->tail(e)); }
 
     Node aNode(OutEdgeIt e) const { 
-      return ((e.forward) ? graph->aNode(e.out) : graph->aNode(e.in)); }
+      return ((e.forward) ? this->graph->aNode(e.out) : 
+	      this->graph->aNode(e.in)); }
     Node bNode(OutEdgeIt e) const { 
-      return ((e.forward) ? graph->bNode(e.out) : graph->bNode(e.in)); }
+      return ((e.forward) ? this->graph->bNode(e.out) : 
+	      this->graph->bNode(e.in)); }
 
     Node aNode(InEdgeIt e) const { 
-      return ((e.forward) ? graph->aNode(e.in) : graph->aNode(e.out)); }
+      return ((e.forward) ? this->graph->aNode(e.in) : 
+	      this->graph->aNode(e.out)); }
     Node bNode(InEdgeIt e) const { 
-      return ((e.forward) ? graph->bNode(e.in) : graph->bNode(e.out)); }
+      return ((e.forward) ? this->graph->bNode(e.in) : 
+	      this->graph->bNode(e.out)); }
 
 //    int nodeNum() const { return graph->nodeNum(); }
@@ -718,5 +744,5 @@
     bool valid(Node n) const { return GraphWrapper<Graph>::valid(n); }
     bool valid(Edge e) const { 
-      return graph->valid(e);
+      return this->graph->valid(e);
 	//return e.forward ? graph->valid(e.out) : graph->valid(e.in); 
     }
@@ -752,5 +778,5 @@
     template <typename T>
     class EdgeMap {
-      typename Graph::EdgeMap<T> forward_map, backward_map; 
+      typename Graph::template EdgeMap<T> forward_map, backward_map; 
     public:
       EdgeMap(const ResGraphWrapper<Graph, Number, CapacityMap, FlowMap>& _G) : forward_map(*(_G.graph)), backward_map(*(_G.graph)) { }
@@ -862,12 +888,16 @@
     using GraphWrapper<Graph>::next;
 //    NodeIt& next(NodeIt& i) const { graph->next(i.n); return i; }
-    OutEdgeIt& next(OutEdgeIt& i) const { graph->next(i.e); return i; }
-    InEdgeIt& next(InEdgeIt& i) const { graph->next(i.e); return i; }
-    EdgeIt& next(EdgeIt& i) const { graph->next(i.e); return i; }    
+    OutEdgeIt& next(OutEdgeIt& i) const { this->graph->next(i.e); return i; }
+    InEdgeIt& next(InEdgeIt& i) const { this->graph->next(i.e); return i; }
+    EdgeIt& next(EdgeIt& i) const { this->graph->next(i.e); return i; }    
     
-    Node aNode(const OutEdgeIt& e) const { return Node(graph->aNode(e.e)); }
-    Node aNode(const InEdgeIt& e) const { return Node(graph->aNode(e.e)); }
-    Node bNode(const OutEdgeIt& e) const { return Node(graph->bNode(e.e)); }
-    Node bNode(const InEdgeIt& e) const { return Node(graph->bNode(e.e)); }
+    Node aNode(const OutEdgeIt& e) const { 
+      return Node(this->graph->aNode(e.e)); }
+    Node aNode(const InEdgeIt& e) const { 
+      return Node(this->graph->aNode(e.e)); }
+    Node bNode(const OutEdgeIt& e) const { 
+      return Node(this->graph->bNode(e.e)); }
+    Node bNode(const InEdgeIt& e) const { 
+      return Node(this->graph->bNode(e.e)); }
 
     void erase(const OutEdgeIt& e) const {
@@ -886,5 +916,6 @@
   template<typename Graph> 
   class BipartiteGraphWrapper : public GraphWrapper<Graph> {
-    typedef IterableBoolMap< typename Graph::NodeMap<int> > SFalseTTrueMap;
+    typedef IterableBoolMap< typename Graph::template NodeMap<int> > 
+    SFalseTTrueMap;
     SFalseTTrueMap* s_false_t_true_map;
     
@@ -984,6 +1015,6 @@
 //       this->s_false_t_true_map->next(n); return n; 
 //     }
-    OutEdgeIt& next(OutEdgeIt& i) const { graph->next(i.e); return i; }
-    InEdgeIt& next(InEdgeIt& i) const { graph->next(i.e); return i; }
+    OutEdgeIt& next(OutEdgeIt& i) const { this->graph->next(i.e); return i; }
+    InEdgeIt& next(InEdgeIt& i) const { this->graph->next(i.e); return i; }
 
     Node tail(const Edge& e) { 
@@ -1079,5 +1110,5 @@
       friend class GraphWrapper<Graph>;
       friend class stGraphWrapper<Graph>;
-      template <typename T> friend class stGraphWrapper<Graph>::NodeMap;
+      template <typename T> friend class NodeMap;
       friend class Edge;
       friend class OutEdgeIt;
@@ -1120,5 +1151,5 @@
       friend class GraphWrapper<Graph>;
       friend class stGraphWrapper<Graph>;
-      template <typename T> friend class stGraphWrapper<Graph>::EdgeMap;
+      template <typename T> friend class EdgeMap;
       int spec;
       typename Graph::Node n;
@@ -1274,6 +1305,6 @@
       switch (i.spec) {
 	case 0:
-	  graph->next(i.n);
-	  if (!graph->valid(i.n)) {
+	  this->graph->next(i.n);
+	  if (!this->graph->valid(i.n)) {
 	    i.spec=1;
 	  }
@@ -1291,8 +1322,8 @@
       switch (i.spec) {
 	case 0: //normal edge
-	  typename Graph::Node v=graph->aNode(i.e);
-	  graph->next(i.e);
-	  if (!graph->valid(i.e)) { //Az igazi elek vegere ertunk
-	    if (graph->inSClass(v)) { //S, nincs kiel
+	  typename Graph::Node v=this->graph->aNode(i.e);
+	  this->graph->next(i.e);
+	  if (!this->graph->valid(i.e)) { //Az igazi elek vegere ertunk
+	    if (this->graph->inSClass(v)) { //S, nincs kiel
 	      i.spec=3;
 	      i.n=INVALID;
@@ -1304,6 +1335,6 @@
 	  break;
 	case 1: //s->vmi
-	  graph->next(i.n);
-	  if (!graph->valid(i.n)) i.spec=3;
+	  this->graph->next(i.n);
+	  if (!this->graph->valid(i.n)) i.spec=3;
 	  break;
 	case 2: //vmi->t
@@ -1317,8 +1348,8 @@
       switch (i.spec) {
 	case 0: //normal edge
-	  typename Graph::Node v=graph->aNode(i.e);
-	  graph->next(i.e);
-	  if (!graph->valid(i.e)) { //Az igazi elek vegere ertunk
-	    if (graph->inTClass(v)) { //S, nincs beel
+	  typename Graph::Node v=this->graph->aNode(i.e);
+	  this->graph->next(i.e);
+	  if (!this->graph->valid(i.e)) { //Az igazi elek vegere ertunk
+	    if (this->graph->inTClass(v)) { //S, nincs beel
 	      i.spec=3;
 	      i.n=INVALID;
@@ -1334,6 +1365,6 @@
 	  break;
 	case 2: //vmi->t
-	  graph->next(i.n);
-	  if (!graph->valid(i.n)) i.spec=3;
+	  this->graph->next(i.n);
+	  if (!this->graph->valid(i.n)) i.spec=3;
 	  break;
       }
@@ -1344,26 +1375,26 @@
       switch (i.spec) {
 	case 0:
-	  graph->next(i.e);
-	  if (!graph->valid(i.e)) { 
+	  this->graph->next(i.e);
+	  if (!this->graph->valid(i.e)) { 
 	    i.spec=1;
-	    graph->first(n, S_CLASS);
-	    if (!graph->valid(i.n)) {
+	    this->graph->first(i.n, S_CLASS);
+	    if (!this->graph->valid(i.n)) {
 	      i.spec=2;
-	      graph->first(n, T_CLASS);
-	      if (!graph->valid(i.n)) spec=3;
+	      this->graph->first(i.n, T_CLASS);
+	      if (!this->graph->valid(i.n)) i.spec=3;
 	    }
 	  }
 	  break;
 	case 1:
-	  graph->next(i.n);
-	  if (!graph->valid(i.n)) {
+	  this->graph->next(i.n);
+	  if (!this->graph->valid(i.n)) {
 	    i.spec=2;
-	    graph->first(n, T_CLASS);
-	    if (!graph->valid(i.n)) spec=3;
+	    this->graph->first(i.n, T_CLASS);
+	    if (!this->graph->valid(i.n)) i.spec=3;
 	  }
 	  break;
 	case 2:
-	  graph->next(i.n);
-	  if (!graph->valid(i.n)) i.spec=3;
+	  this->graph->next(i.n);
+	  if (!this->graph->valid(i.n)) i.spec=3;
 	  break;
       }
@@ -1374,5 +1405,5 @@
       switch (e.spec) {
 	case 0: 
-	  return Node(graph->tail(e));
+	  return Node(this->graph->tail(e));
 	  break;
 	case 1:
@@ -1387,5 +1418,5 @@
       switch (e.spec) {
 	case 0: 
-	  return Node(graph->head(e));
+	  return Node(this->graph->head(e));
 	  break;
 	case 1:
@@ -1401,6 +1432,6 @@
     bool valid(const Edge& e) const { return (e.spec<3); }
 
-//    int nodeNum() const { return graph->nodeNum(); }
-//    int edgeNum() const { return graph->edgeNum(); }
+//    int nodeNum() const { return this->graph->nodeNum(); }
+//    int edgeNum() const { return this->graph->edgeNum(); }
   
     Node aNode(const OutEdgeIt& e) const { return tail(e); }
@@ -1409,20 +1440,21 @@
     Node bNode(const InEdgeIt& e) const { return tail(e); }
   
-//    Node addNode() const { return Node(graph->addNode()); }
+//    Node addNode() const { return Node(this->graph->addNode()); }
 //    Edge addEdge(const Node& tail, const Node& head) const { 
-//      return Edge(graph->addEdge(tail, head)); }
-
-//    void erase(const Node& i) const { graph->erase(i); }
-//    void erase(const Edge& i) const { graph->erase(i); }
+//      return Edge(this->graph->addEdge(tail, head)); }
+
+//    void erase(const Node& i) const { this->graph->erase(i); }
+//    void erase(const Edge& i) const { this->graph->erase(i); }
   
-//    void clear() const { graph->clear(); }
+//    void clear() const { this->graph->clear(); }
     
-    template<typename T> class NodeMap : public GraphWrapper<Graph>::NodeMap<T> { 
+    template<typename T> class NodeMap : public GraphWrapper<Graph>::template NodeMap<T> { 
+      typedef typename GraphWrapper<Graph>::template NodeMap<T> Parent;
       T s_value, t_value;
     public:
-      NodeMap(const stGraphWrapper<Graph>& _G) :  
-	GraphWrapper<Graph>::NodeMap<T>(_G) { }
-      NodeMap(const stGraphWrapper<Graph>& _G, T a) : 
-	GraphWrapper<Graph>::NodeMap<T>(_G, a), s_value(a), t_value(a) { }
+      NodeMap(const stGraphWrapper<Graph>& _G) :  Parent(_G) { }
+      NodeMap(const stGraphWrapper<Graph>& _G, T a) : Parent(_G, a), 
+						      s_value(a), 
+						      t_value(a) { }
       T operator[](const Node& n) const { 
 	switch (n.spec) {
@@ -1441,5 +1473,5 @@
 	switch (n.spec) {
 	  case 0: 
-	    GraphWrapper<Graph>::NodeMap<T>::set(n, t);
+	    GraphWrapper<Graph>::template NodeMap<T>::set(n, t);
 	    break;
 	  case 1:
@@ -1453,11 +1485,12 @@
     };
 
-    template<typename T> class EdgeMap : public GraphWrapper<Graph>::EdgeMap<T> { 
-      typename GraphWrapper<Graph>::NodeMap<T> node_value;
-    public:
-      EdgeMap(const stGraphWrapper<Graph>& _G) :  
-	GraphWrapper<Graph>::EdgeMap<T>(_G), node_value(_G) { }
-      EdgeMap(const stGraphWrapper<Graph>& _G, T a) : 
-	GraphWrapper<Graph>::EdgeMap<T>(_G, a), node_value(_G, a) { }
+    template<typename T> class EdgeMap : public GraphWrapper<Graph>::template EdgeMap<T> { 
+      typedef typename Graph::template NodeMap<T> Parent;
+      typename GraphWrapper<Graph>::template NodeMap<T> node_value;
+    public:
+      EdgeMap(const stGraphWrapper<Graph>& _G) :  Parent(_G), 
+						  node_value(_G) { }
+      EdgeMap(const stGraphWrapper<Graph>& _G, T a) : Parent(_G, a), 
+						      node_value(_G, a) { }
       T operator[](const Edge& e) const { 
 	switch (e.spec) {
Index: src/work/marci/iterator_bfs_demo.cc
===================================================================
--- src/work/marci/iterator_bfs_demo.cc	(revision 360)
+++ src/work/marci/iterator_bfs_demo.cc	(revision 389)
@@ -5,5 +5,5 @@
 
 #include <list_graph.h>
-#include <smart_graph.h>
+//#include <smart_graph.h>
 #include <bfs_iterator.h>
 #include <graph_wrapper.h>
Index: src/work/marci/makefile
===================================================================
--- src/work/marci/makefile	(revision 380)
+++ src/work/marci/makefile	(revision 389)
@@ -1,6 +1,6 @@
 CXX2 = g++-2.95
-CXX3 := $(shell type -p g++-3.3 || type -p g++-3.2 || type -p g++-3.0 || type -p g++-3 || echo g++)
-CXX=$(CXX3)
-CC=$(CXX)
+#CXX3 := $(shell type -p g++-3.3 || type -p g++-3.2 || type -p g++-3.0 || type -p g++-3 || echo g++)
+#CXX=$(CXX3)
+#CC=$(CXX)
 #LEDAROOT ?= /ledasrc/LEDA-4.1
 BOOSTROOT ?= /home/marci/boost
@@ -13,14 +13,15 @@
 #gw_vs_not preflow_demo_boost edmonds_karp_demo_boost preflow_demo_jacint preflow_demo_athos edmonds_karp_demo_alpar preflow_demo_leda
 
-all: $(BINARIES)
+include ../makefile
+#all: $(BINARIES)
 
-.depend dep depend:
-	-$(CXX) $(INCLUDEDIRS) -M $(BINARIES:=.cc) > .depend #2>/dev/null
+#.depend dep depend:
+#	-$(CXX) $(INCLUDEDIRS) -M $(BINARIES:=.cc) > .depend #2>/dev/null
 #	-g++ $(INCLUDEDIRS) $(LEDAINCLUDE) -M $(LEDABINARIES:=.cc) >> .depend #2>/dev/null
 
 
 
-makefile: .depend
-sinclude .depend
+#makefile: .depend
+#sinclude .depend
 
 leda_graph_demo.o:
@@ -73,6 +74,6 @@
 	$(CXX3) $(CXXFLAGS) -I. -I.. -I../athos -o preflow_demo_athos preflow_demo_athos.cc
 
-clean:
-	$(RM) *.o $(BINARIES) .depend
-
-.PHONY: all clean dep depend
+#clean:
+#	$(RM) *.o $(BINARIES) .depend
+#
+#.PHONY: all clean dep depend
