Index: lemon/bits/graph_extender.h
===================================================================
--- lemon/bits/graph_extender.h	(revision 57)
+++ lemon/bits/graph_extender.h	(revision 78)
@@ -21,4 +21,5 @@
 
 #include <lemon/bits/invalid.h>
+#include <lemon/bits/utility.h>
 
 #include <lemon/bits/map_extender.h>
@@ -64,9 +65,9 @@
     }
 
-    Node oppositeNode(const Node &n, const Arc &e) const {
-      if (n == Parent::source(e))
-	return Parent::target(e);
-      else if(n==Parent::target(e))
-	return Parent::source(e);
+    Node oppositeNode(const Node &node, const Arc &arc) const {
+      if (node == Parent::source(arc))
+	return Parent::target(arc);
+      else if(node == Parent::target(arc))
+	return Parent::source(arc);
       else
 	return INVALID;
@@ -95,5 +96,5 @@
 
     class NodeIt : public Node { 
-      const Digraph* digraph;
+      const Digraph* _digraph;
     public:
 
@@ -102,13 +103,13 @@
       NodeIt(Invalid i) : Node(i) { }
 
-      explicit NodeIt(const Digraph& _digraph) : digraph(&_digraph) {
-	_digraph.first(static_cast<Node&>(*this));
-      }
-
-      NodeIt(const Digraph& _digraph, const Node& node) 
-	: Node(node), digraph(&_digraph) {}
+      explicit NodeIt(const Digraph& digraph) : _digraph(&digraph) {
+	_digraph->first(static_cast<Node&>(*this));
+      }
+
+      NodeIt(const Digraph& digraph, const Node& node) 
+	: Node(node), _digraph(&digraph) {}
 
       NodeIt& operator++() { 
-	digraph->next(*this);
+	_digraph->next(*this);
 	return *this; 
       }
@@ -118,5 +119,5 @@
 
     class ArcIt : public Arc { 
-      const Digraph* digraph;
+      const Digraph* _digraph;
     public:
 
@@ -125,13 +126,13 @@
       ArcIt(Invalid i) : Arc(i) { }
 
-      explicit ArcIt(const Digraph& _digraph) : digraph(&_digraph) {
-	_digraph.first(static_cast<Arc&>(*this));
-      }
-
-      ArcIt(const Digraph& _digraph, const Arc& e) : 
-	Arc(e), digraph(&_digraph) { }
+      explicit ArcIt(const Digraph& digraph) : _digraph(&digraph) {
+	_digraph->first(static_cast<Arc&>(*this));
+      }
+
+      ArcIt(const Digraph& digraph, const Arc& arc) : 
+	Arc(arc), _digraph(&digraph) { }
 
       ArcIt& operator++() { 
-	digraph->next(*this);
+	_digraph->next(*this);
 	return *this; 
       }
@@ -141,5 +142,5 @@
 
     class OutArcIt : public Arc { 
-      const Digraph* digraph;
+      const Digraph* _digraph;
     public:
 
@@ -148,14 +149,14 @@
       OutArcIt(Invalid i) : Arc(i) { }
 
-      OutArcIt(const Digraph& _digraph, const Node& node) 
-	: digraph(&_digraph) {
-	_digraph.firstOut(*this, node);
-      }
-
-      OutArcIt(const Digraph& _digraph, const Arc& arc) 
-	: Arc(arc), digraph(&_digraph) {}
+      OutArcIt(const Digraph& digraph, const Node& node) 
+	: _digraph(&digraph) {
+	_digraph->firstOut(*this, node);
+      }
+
+      OutArcIt(const Digraph& digraph, const Arc& arc) 
+	: Arc(arc), _digraph(&digraph) {}
 
       OutArcIt& operator++() { 
-	digraph->nextOut(*this);
+	_digraph->nextOut(*this);
 	return *this; 
       }
@@ -165,5 +166,5 @@
 
     class InArcIt : public Arc { 
-      const Digraph* digraph;
+      const Digraph* _digraph;
     public:
 
@@ -172,14 +173,14 @@
       InArcIt(Invalid i) : Arc(i) { }
 
-      InArcIt(const Digraph& _digraph, const Node& node) 
-	: digraph(&_digraph) {
-	_digraph.firstIn(*this, node);
-      }
-
-      InArcIt(const Digraph& _digraph, const Arc& arc) : 
-	Arc(arc), digraph(&_digraph) {}
+      InArcIt(const Digraph& digraph, const Node& node) 
+	: _digraph(&digraph) {
+	_digraph->firstIn(*this, node);
+      }
+
+      InArcIt(const Digraph& digraph, const Arc& arc) : 
+	Arc(arc), _digraph(&digraph) {}
 
       InArcIt& operator++() { 
-	digraph->nextIn(*this);
+	_digraph->nextIn(*this);
 	return *this; 
       }
@@ -190,6 +191,6 @@
     ///
     /// Returns the base node (i.e. the source in this case) of the iterator
-    Node baseNode(const OutArcIt &e) const {
-      return Parent::source(e);
+    Node baseNode(const OutArcIt &arc) const {
+      return Parent::source(arc);
     }
     /// \brief Running node of the iterator
@@ -197,6 +198,6 @@
     /// Returns the running node (i.e. the target in this case) of the
     /// iterator
-    Node runningNode(const OutArcIt &e) const {
-      return Parent::target(e);
+    Node runningNode(const OutArcIt &arc) const {
+      return Parent::target(arc);
     }
 
@@ -204,6 +205,6 @@
     ///
     /// Returns the base node (i.e. the target in this case) of the iterator
-    Node baseNode(const InArcIt &e) const {
-      return Parent::target(e);
+    Node baseNode(const InArcIt &arc) const {
+      return Parent::target(arc);
     }
     /// \brief Running node of the iterator
@@ -211,6 +212,6 @@
     /// Returns the running node (i.e. the source in this case) of the
     /// iterator
-    Node runningNode(const InArcIt &e) const {
-      return Parent::source(e);
+    Node runningNode(const InArcIt &arc) const {
+      return Parent::source(arc);
     }
 
@@ -324,5 +325,5 @@
   };
 
-  /// \ingroup graphbits
+  /// \ingroup _graphbits
   ///
   /// \brief Extender for the Graphs
@@ -332,5 +333,7 @@
     
     typedef Base Parent;
-    typedef GraphExtender Digraph;
+    typedef GraphExtender Graph;
+
+    typedef True UndirectedTag;
 
     typedef typename Parent::Node Node;
@@ -373,11 +376,11 @@
     }
 
-    Arc oppositeArc(const Arc &e) const {
-      return Parent::direct(e, !Parent::direction(e));
+    Arc oppositeArc(const Arc &arc) const {
+      return Parent::direct(arc, !Parent::direction(arc));
     }
 
     using Parent::direct;
-    Arc direct(const Edge &ue, const Node &s) const {
-      return Parent::direct(ue, Parent::source(ue) == s);
+    Arc direct(const Edge &edge, const Node &node) const {
+      return Parent::direct(edge, Parent::source(edge) == node);
     }
 
@@ -412,5 +415,5 @@
 
     class NodeIt : public Node { 
-      const Digraph* digraph;
+      const Graph* _graph;
     public:
 
@@ -419,13 +422,13 @@
       NodeIt(Invalid i) : Node(i) { }
 
-      explicit NodeIt(const Digraph& _digraph) : digraph(&_digraph) {
-	_digraph.first(static_cast<Node&>(*this));
-      }
-
-      NodeIt(const Digraph& _digraph, const Node& node) 
-	: Node(node), digraph(&_digraph) {}
+      explicit NodeIt(const Graph& graph) : _graph(&graph) {
+	_graph->first(static_cast<Node&>(*this));
+      }
+
+      NodeIt(const Graph& graph, const Node& node) 
+	: Node(node), _graph(&graph) {}
 
       NodeIt& operator++() { 
-	digraph->next(*this);
+	_graph->next(*this);
 	return *this; 
       }
@@ -435,5 +438,5 @@
 
     class ArcIt : public Arc { 
-      const Digraph* digraph;
+      const Graph* _graph;
     public:
 
@@ -442,13 +445,13 @@
       ArcIt(Invalid i) : Arc(i) { }
 
-      explicit ArcIt(const Digraph& _digraph) : digraph(&_digraph) {
-	_digraph.first(static_cast<Arc&>(*this));
-      }
-
-      ArcIt(const Digraph& _digraph, const Arc& e) : 
-	Arc(e), digraph(&_digraph) { }
+      explicit ArcIt(const Graph& graph) : _graph(&graph) {
+	_graph->first(static_cast<Arc&>(*this));
+      }
+
+      ArcIt(const Graph& graph, const Arc& arc) : 
+	Arc(arc), _graph(&graph) { }
 
       ArcIt& operator++() { 
-	digraph->next(*this);
+	_graph->next(*this);
 	return *this; 
       }
@@ -458,5 +461,5 @@
 
     class OutArcIt : public Arc { 
-      const Digraph* digraph;
+      const Graph* _graph;
     public:
 
@@ -465,14 +468,14 @@
       OutArcIt(Invalid i) : Arc(i) { }
 
-      OutArcIt(const Digraph& _digraph, const Node& node) 
-	: digraph(&_digraph) {
-	_digraph.firstOut(*this, node);
-      }
-
-      OutArcIt(const Digraph& _digraph, const Arc& arc) 
-	: Arc(arc), digraph(&_digraph) {}
+      OutArcIt(const Graph& graph, const Node& node) 
+	: _graph(&graph) {
+	_graph->firstOut(*this, node);
+      }
+
+      OutArcIt(const Graph& graph, const Arc& arc) 
+	: Arc(arc), _graph(&graph) {}
 
       OutArcIt& operator++() { 
-	digraph->nextOut(*this);
+	_graph->nextOut(*this);
 	return *this; 
       }
@@ -482,5 +485,5 @@
 
     class InArcIt : public Arc { 
-      const Digraph* digraph;
+      const Graph* _graph;
     public:
 
@@ -489,14 +492,14 @@
       InArcIt(Invalid i) : Arc(i) { }
 
-      InArcIt(const Digraph& _digraph, const Node& node) 
-	: digraph(&_digraph) {
-	_digraph.firstIn(*this, node);
-      }
-
-      InArcIt(const Digraph& _digraph, const Arc& arc) : 
-	Arc(arc), digraph(&_digraph) {}
+      InArcIt(const Graph& graph, const Node& node) 
+	: _graph(&graph) {
+	_graph->firstIn(*this, node);
+      }
+
+      InArcIt(const Graph& graph, const Arc& arc) : 
+	Arc(arc), _graph(&graph) {}
 
       InArcIt& operator++() { 
-	digraph->nextIn(*this);
+	_graph->nextIn(*this);
 	return *this; 
       }
@@ -506,5 +509,5 @@
 
     class EdgeIt : public Parent::Edge { 
-      const Digraph* digraph;
+      const Graph* _graph;
     public:
 
@@ -513,39 +516,39 @@
       EdgeIt(Invalid i) : Edge(i) { }
 
-      explicit EdgeIt(const Digraph& _digraph) : digraph(&_digraph) {
-	_digraph.first(static_cast<Edge&>(*this));
-      }
-
-      EdgeIt(const Digraph& _digraph, const Edge& e) : 
-	Edge(e), digraph(&_digraph) { }
+      explicit EdgeIt(const Graph& graph) : _graph(&graph) {
+	_graph->first(static_cast<Edge&>(*this));
+      }
+
+      EdgeIt(const Graph& graph, const Edge& edge) : 
+	Edge(edge), _graph(&graph) { }
 
       EdgeIt& operator++() { 
-	digraph->next(*this);
-	return *this; 
-      }
-
-    };
-
-    class IncArcIt : public Parent::Edge {
+	_graph->next(*this);
+	return *this; 
+      }
+
+    };
+
+    class IncEdgeIt : public Parent::Edge {
       friend class GraphExtender;
-      const Digraph* digraph;
-      bool direction;
-    public:
-
-      IncArcIt() { }
-
-      IncArcIt(Invalid i) : Edge(i), direction(false) { }
-
-      IncArcIt(const Digraph& _digraph, const Node &n) : digraph(&_digraph) {
-	_digraph.firstInc(*this, direction, n);
-      }
-
-      IncArcIt(const Digraph& _digraph, const Edge &ue, const Node &n)
-	: digraph(&_digraph), Edge(ue) {
-	direction = (_digraph.source(ue) == n);
-      }
-
-      IncArcIt& operator++() {
-	digraph->nextInc(*this, direction);
+      const Graph* _graph;
+      bool _direction;
+    public:
+
+      IncEdgeIt() { }
+
+      IncEdgeIt(Invalid i) : Edge(i), _direction(false) { }
+
+      IncEdgeIt(const Graph& graph, const Node &node) : _graph(&graph) {
+	_graph->firstInc(*this, _direction, node);
+      }
+
+      IncEdgeIt(const Graph& graph, const Edge &edge, const Node &node)
+	: _graph(&graph), Edge(edge) {
+	_direction = (_graph->source(edge) == node);
+      }
+
+      IncEdgeIt& operator++() {
+	_graph->nextInc(*this, _direction);
 	return *this; 
       }
@@ -555,6 +558,6 @@
     ///
     /// Returns the base node (ie. the source in this case) of the iterator
-    Node baseNode(const OutArcIt &e) const {
-      return Parent::source(static_cast<const Arc&>(e));
+    Node baseNode(const OutArcIt &arc) const {
+      return Parent::source(static_cast<const Arc&>(arc));
     }
     /// \brief Running node of the iterator
@@ -562,6 +565,6 @@
     /// Returns the running node (ie. the target in this case) of the
     /// iterator
-    Node runningNode(const OutArcIt &e) const {
-      return Parent::target(static_cast<const Arc&>(e));
+    Node runningNode(const OutArcIt &arc) const {
+      return Parent::target(static_cast<const Arc&>(arc));
     }
 
@@ -569,6 +572,6 @@
     ///
     /// Returns the base node (ie. the target in this case) of the iterator
-    Node baseNode(const InArcIt &e) const {
-      return Parent::target(static_cast<const Arc&>(e));
+    Node baseNode(const InArcIt &arc) const {
+      return Parent::target(static_cast<const Arc&>(arc));
     }
     /// \brief Running node of the iterator
@@ -576,6 +579,6 @@
     /// Returns the running node (ie. the source in this case) of the
     /// iterator
-    Node runningNode(const InArcIt &e) const {
-      return Parent::source(static_cast<const Arc&>(e));
+    Node runningNode(const InArcIt &arc) const {
+      return Parent::source(static_cast<const Arc&>(arc));
     }
 
@@ -583,12 +586,12 @@
     ///
     /// Returns the base node of the iterator
-    Node baseNode(const IncArcIt &e) const {
-      return e.direction ? source(e) : target(e);
+    Node baseNode(const IncEdgeIt &edge) const {
+      return edge._direction ? source(edge) : target(edge);
     }
     /// Running node of the iterator
     ///
     /// Returns the running node of the iterator
-    Node runningNode(const IncArcIt &e) const {
-      return e.direction ? target(e) : source(e);
+    Node runningNode(const IncEdgeIt &edge) const {
+      return edge._direction ? target(edge) : source(edge);
     }
 
@@ -597,13 +600,13 @@
     template <typename _Value>
     class NodeMap 
-      : public MapExtender<DefaultMap<Digraph, Node, _Value> > {
-    public:
-      typedef GraphExtender Digraph;
-      typedef MapExtender<DefaultMap<Digraph, Node, _Value> > Parent;
-
-      NodeMap(const Digraph& digraph) 
-	: Parent(digraph) {}
-      NodeMap(const Digraph& digraph, const _Value& value) 
-	: Parent(digraph, value) {}
+      : public MapExtender<DefaultMap<Graph, Node, _Value> > {
+    public:
+      typedef GraphExtender Graph;
+      typedef MapExtender<DefaultMap<Graph, Node, _Value> > Parent;
+
+      NodeMap(const Graph& graph) 
+	: Parent(graph) {}
+      NodeMap(const Graph& graph, const _Value& value) 
+	: Parent(graph, value) {}
 
       NodeMap& operator=(const NodeMap& cmap) {
@@ -621,13 +624,13 @@
     template <typename _Value>
     class ArcMap 
-      : public MapExtender<DefaultMap<Digraph, Arc, _Value> > {
-    public:
-      typedef GraphExtender Digraph;
-      typedef MapExtender<DefaultMap<Digraph, Arc, _Value> > Parent;
-
-      ArcMap(const Digraph& digraph) 
-	: Parent(digraph) {}
-      ArcMap(const Digraph& digraph, const _Value& value) 
-	: Parent(digraph, value) {}
+      : public MapExtender<DefaultMap<Graph, Arc, _Value> > {
+    public:
+      typedef GraphExtender Graph;
+      typedef MapExtender<DefaultMap<Graph, Arc, _Value> > Parent;
+
+      ArcMap(const Graph& graph) 
+	: Parent(graph) {}
+      ArcMap(const Graph& graph, const _Value& value) 
+	: Parent(graph, value) {}
 
       ArcMap& operator=(const ArcMap& cmap) {
@@ -645,14 +648,14 @@
     template <typename _Value>
     class EdgeMap 
-      : public MapExtender<DefaultMap<Digraph, Edge, _Value> > {
-    public:
-      typedef GraphExtender Digraph;
-      typedef MapExtender<DefaultMap<Digraph, Edge, _Value> > Parent;
-
-      EdgeMap(const Digraph& digraph) 
-	: Parent(digraph) {}
-
-      EdgeMap(const Digraph& digraph, const _Value& value) 
-	: Parent(digraph, value) {}
+      : public MapExtender<DefaultMap<Graph, Edge, _Value> > {
+    public:
+      typedef GraphExtender Graph;
+      typedef MapExtender<DefaultMap<Graph, Edge, _Value> > Parent;
+
+      EdgeMap(const Graph& graph) 
+	: Parent(graph) {}
+
+      EdgeMap(const Graph& graph, const _Value& value) 
+	: Parent(graph, value) {}
 
       EdgeMap& operator=(const EdgeMap& cmap) {
@@ -693,8 +696,8 @@
     }
 
-    template <typename Digraph, typename NodeRefMap, typename EdgeRefMap>
-    void build(const Digraph& digraph, NodeRefMap& nodeRef, 
+    template <typename Graph, typename NodeRefMap, typename EdgeRefMap>
+    void build(const Graph& graph, NodeRefMap& nodeRef, 
                EdgeRefMap& edgeRef) {
-      Parent::build(digraph, nodeRef, edgeRef);
+      Parent::build(graph, nodeRef, edgeRef);
       notifier(Node()).build();
       notifier(Edge()).build();
@@ -721,8 +724,8 @@
 
     void erase(const Edge& edge) {
-      std::vector<Arc> ev;
-      ev.push_back(Parent::direct(edge, true));
-      ev.push_back(Parent::direct(edge, false));      
-      notifier(Arc()).erase(ev);
+      std::vector<Arc> av;
+      av.push_back(Parent::direct(edge, true));
+      av.push_back(Parent::direct(edge, false));      
+      notifier(Arc()).erase(av);
       notifier(Edge()).erase(edge);
       Parent::erase(edge);
