diff --git a/alib2algo/src/rte/convert/ToPostfixPushdownAutomatonGlushkov.cpp b/alib2algo/src/rte/convert/ToPostfixPushdownAutomatonGlushkov.cpp
index 4d5a0f3f8b11a4f8fcb47f8874eec7f5bc3c4b2c..b61a1c1566c081211ca31bf71a09abed9625e61a 100644
--- a/alib2algo/src/rte/convert/ToPostfixPushdownAutomatonGlushkov.cpp
+++ b/alib2algo/src/rte/convert/ToPostfixPushdownAutomatonGlushkov.cpp
@@ -6,235 +6,14 @@
  */
 
 #include "ToPostfixPushdownAutomatonGlushkov.h"
-
-#include <alphabet/EndSymbol.h>
-
-#include <global/GlobalData.h>
 #include <registration/AlgoRegistration.hpp>
 
-#include "../glushkov/GlushkovFollow.h"
-#include "../glushkov/GlushkovIndexate.h"
-#include "../glushkov/GlushkovFirst.h"
-#include "../glushkov/GlushkovSubstitutionMap.h"
-
 namespace rte {
 
 namespace convert {
 
-inline common::ranked_symbol < DefaultSymbolType, DefaultRankType > phi ( const common::ranked_symbol < ext::pair < DefaultSymbolType, unsigned >, DefaultRankType > & symbol ) {
-	return common::ranked_symbol < DefaultSymbolType, DefaultRankType > ( symbol.getSymbol ( ).first, symbol.getRank ( ) );
-}
-
-/*ext::vector < ext::variant < common::ranked_symbol < DefaultSymbolType, DefaultRankType >, DefaultSymbolType > > phi ( const ext::vector < common::ranked_symbol < ext::pair < DefaultSymbolType, unsigned >, DefaultRankType > > & follow ) {
-	return ext::transform < ext::variant < common::ranked_symbol < DefaultSymbolType, DefaultRankType >, DefaultSymbolType > > ( follow, []( const common::ranked_symbol < ext::pair < DefaultSymbolType, unsigned >, DefaultRankType > & symbol ) { return phi ( symbol ); } );
-}*/
-
-template < class SymbolType, class RankType >
-bool ToPostfixPushdownAutomatonGlushkov::isSubstSymbolPresent ( const ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > > & container, const TAlphabet < SymbolType, RankType > & substAlphabet ) {
-	ext::vector < common::ranked_symbol < ext::pair < DefaultSymbolType, unsigned >, DefaultRankType > > intersection;
-	std::set_intersection ( container.begin ( ), container.end ( ), substAlphabet.begin ( ), substAlphabet.end ( ), std::back_inserter ( intersection ) );
-	return intersection.size ( ) > 0;
-}
-
-template < class SymbolType, class RankType >
-automaton::NPDA < ext::variant < common::ranked_symbol < SymbolType, RankType >, alphabet::EndSymbol >, DefaultEpsilonType, ext::variant < alphabet::BottomOfTheStackSymbol, ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > > >, char > ToPostfixPushdownAutomatonGlushkov::convert ( const rte::FormalRTE < > & rte ) {
-
-	 // step 1; index RTE
-	rte::FormalRTE < ext::pair < DefaultSymbolType, unsigned >, DefaultRankType > indexedRTE = rte::GlushkovIndexate::index ( rte );
-
-	 // step 2; compute:
-	 // - first set
-	const ext::set < common::ranked_symbol < ext::pair < DefaultSymbolType, unsigned >, DefaultRankType > > firstSet = rte::GlushkovFirst::first ( indexedRTE );
-
-	 // - follow set for every element of (non-indexed) RTE alphabet element
-	const ext::map < const rte::FormalRTEElement < ext::pair < SymbolType, unsigned >, RankType >*, ext::map < common::ranked_symbol < ext::pair < DefaultSymbolType, unsigned >, DefaultRankType >, ext::set < common::ranked_symbol < ext::pair < DefaultSymbolType, unsigned >, DefaultRankType > > > > substMapTree = GlushkovSubstitutionMap::substMap ( indexedRTE );
-	ext::map < common::ranked_symbol < ext::pair < DefaultSymbolType, unsigned >, DefaultRankType >, ext::set < GlushkovFollow::TFollowTuple < SymbolType, RankType > > > followSet;
-
-	for ( const common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > & symbol : indexedRTE.getAlphabet ( ) )
-		followSet.insert ( std::make_pair ( symbol, rte::GlushkovFollow::follow ( indexedRTE, symbol, substMapTree ) ) );
-
-	/* check for exceptions -> there must be NO substitution symbol in first set */
-	if ( isSubstSymbolPresent ( firstSet, indexedRTE.getSubstitutionAlphabet ( ) ) )
-		throw exception::CommonException ( "GlushkovRTE: Substitution symbol appeared in the first set" );
-	/* check end */
-
-	/* check for exceptions -> there must be NO substitution symbol in follow sets */
-	for ( const std::pair < const common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType >, ext::set < GlushkovFollow::TFollowTuple < SymbolType, RankType > > > & kv : followSet )
-		for ( const GlushkovFollow::TFollowTuple < SymbolType, RankType > & followTuple : kv.second ) // TFollowTuple = vector < set < ranked_symbol > >
-			for ( const ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > > & followTupleElem : followTuple )
-				if ( isSubstSymbolPresent ( followTupleElem, indexedRTE.getSubstitutionAlphabet ( ) ) )
-					throw exception::CommonException ( "GlushkovRTE: Substitution symbol appeared in a follow set" );
-	/* check end */
-
-	 // step 3; create PDA (w/o transitions yet) and initialize input alphabet = (non-indexed) RTE alphabet and END symbol
-	char q = 'q';
-	char f = 'f';
-
-	auto BotS = ext::variant < alphabet::BottomOfTheStackSymbol, ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > > >::template from < alphabet::BottomOfTheStackSymbol > ( );
-	automaton::NPDA < ext::variant < common::ranked_symbol < SymbolType, RankType >, alphabet::EndSymbol >, DefaultEpsilonType, ext::variant < alphabet::BottomOfTheStackSymbol, ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > > >, char > automaton ( q, BotS );
-
-	automaton.addState ( f );
-	automaton.addFinalState ( f );
-
-	for ( const common::ranked_symbol < SymbolType, RankType > & symbol : rte.getAlphabet ( ) )
-		automaton.addInputSymbol ( symbol );
-
-	automaton.addInputSymbol ( alphabet::EndSymbol { } );
-
-	// step 4; create pushdown store alphabet;
-
-	// simple
-	for ( const common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > & symb : indexedRTE.getAlphabet ( ) )
-		automaton.addPushdownStoreSymbol ( ext::variant < alphabet::BottomOfTheStackSymbol, ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > > > ( { symb } ) );
-
-	// complex
-	for ( const std::pair < const rte::FormalRTEElement < ext::pair < SymbolType, unsigned >, RankType >* const, ext::map < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType >, ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > > > > & kv : substMapTree ) {
-		if ( dynamic_cast < const rte::FormalRTESymbolSubst < ext::pair < SymbolType, unsigned >, RankType > * const > ( kv.first ) ) {
-			for ( const std::pair < common::ranked_symbol < ext::pair < SymbolType, unsigned > >, ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned > > > > & kv2 : kv.second ) {
-				automaton.addPushdownStoreSymbol ( kv2.second );
-			}
-		}
-	}
-
-	/* DEBUG */
-	if ( common::GlobalData::verbose ) {
-		common::Streams::err << "RTE:" << std::endl;
-		for ( const auto & symbol : indexedRTE.getAlphabet ( ) )
-			common::Streams::err << "\t" << symbol << std::endl;
-		common::Streams::err << std::endl;
-
-		common::Streams::err << "First(RTE):" << std::endl;
-		for ( const auto & symbol : firstSet )
-			common::Streams::err << "\t" << symbol << std::endl;
-		common::Streams::err << std::endl;
-
-		common::Streams::err << "subMap:" << std::endl;
-			// const ext::map <
-			//   const rte::FormalRTEElement < SymbolType, RankType >*,
-			//   ext::map < common::ranked_symbol < >, ext::set < common::ranked_symbol < > > > >
-			// substMapTree = GlushkovSubstitutionMap::substMap ( indexedRTE );
-		for ( const auto & nodes : substMapTree ) {
-			common::Streams::err << *nodes.first << std::endl;
-			for ( const auto & mapping : nodes.second ) {
-				common::Streams::err << "\t" << mapping.first << " -> " << std::endl;
-				for ( const auto & elem : mapping.second )
-					common::Streams::err << "\t\t" << elem << std::endl;
-			}
-		}
-		common::Streams::err << std::endl;
-
-		// ext::map < common::ranked_symbol < >, ext::set < GlushkovFollow::TFollowTuple < SymbolType, RankType > > > followSet;
-		for ( const std::pair < const common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType >, ext::set < GlushkovFollow::TFollowTuple < SymbolType, RankType > > >& kv : followSet ) {
-			common::Streams::err << "Follow(RTE, " << kv.first << "):" << std::endl;
-
-			if ( kv.second.empty ( ) )
-				common::Streams::err << "\t" << "{}" << std::endl;
-
-			for ( const GlushkovFollow::TFollowTuple < SymbolType, RankType > & followTuple : kv.second ) { // TFollowTuple = vector < set < ranked_symbol > >
-				common::Streams::err << " \t - FollowTuple:" << std::endl;
-				for ( const ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > > & child : followTuple )
-					common::Streams::err << "\t\t - " << child << std::endl;
-
-				common::Streams::err << std::endl;
-			}
-
-			common::Streams::err << std::endl;
-		}
-
-		common::Streams::err << "---------------------------------------------------------" << std::endl;
-		common::Streams::err << "PDA:" << std::endl;
-		common::Streams::err << "pds symbols" << std::endl;
-
-		for ( const auto & symb : automaton.getPushdownStoreAlphabet ( ) )
-			common::Streams::err << "\t" << symb << std::endl;
-		common::Streams::err << std::endl;
-	}
-	/* DEBUG END */
-
-
-	/* TRANSITIONS */
-	// Pattern 3 and 2
-	for ( const common::ranked_symbol < ext::pair < DefaultSymbolType, unsigned >, DefaultRankType > & symb : indexedRTE.getAlphabet ( ) ) {
-		if ( symb.getRank ( ) == unsigned ( 0 ) ) {
-			ext::vector < ext::variant < alphabet::BottomOfTheStackSymbol, ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > > > > push;
-			push.push_back ( ext::variant < alphabet::BottomOfTheStackSymbol, ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > > > ( { symb } ) );
-
-			if ( common::GlobalData::verbose ) {
-				common::Streams::err << "Transition 3: " << symb.getSymbol ( ).first << " | " << std::endl <<
-					"\t" << "[]" << std::endl <<
-					"\t ->" << std::endl <<
-					"\t" << push << std::endl << std::endl;
-			}
-			automaton.addTransition ( q, phi ( symb ), { }, q, push );
-		} else {
-			for ( const GlushkovFollow::TFollowTuple < SymbolType, RankType > & followTuple : followSet [ symb ] ) { //tuple = vector < set < symb > >
-				ext::vector < ext::variant < alphabet::BottomOfTheStackSymbol, ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > > > > pop, push;
-
-				for ( const auto & e : followTuple )
-				   pop.push_back ( e );
-				std::reverse ( pop.begin ( ), pop.end ( ) );
-
-				push.push_back( ext::variant < alphabet::BottomOfTheStackSymbol, ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > > > ( { symb } ) );
-
-				if ( common::GlobalData::verbose ) {
-					common::Streams::err << "Transition 2: " << symb.getSymbol ( ).first << " | " << std::endl <<
-						"\t" << pop << std::endl <<
-						"\t ->" << std::endl <<
-						"\t" << push << std::endl << std::endl;
-				}
-				automaton.addTransition ( q, phi ( symb ), pop, q, push );
-			}
-		}
-	}
-
-	// Pattern 1
-	for ( const common::ranked_symbol < ext::pair < DefaultSymbolType, unsigned >, DefaultRankType > & symb : indexedRTE.getAlphabet ( ) ) {
-		for ( const std::pair < const rte::FormalRTEElement < ext::pair < SymbolType, unsigned >, RankType >* const, ext::map < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType >, ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > > > > & kv : substMapTree ) {
-			if ( dynamic_cast < const rte::FormalRTESymbolSubst < ext::pair < SymbolType, unsigned >, RankType > * const > ( kv.first ) == nullptr ) // not a SubstSymbol node
-				continue;
-
-			for ( const std::pair < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType >, ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > > > & kv2 : kv.second ) {
-				if ( kv2.second.count ( symb ) == 0 )
-					continue;
-
-				for ( const GlushkovFollow::TFollowTuple < SymbolType, RankType > & symbFollowTuple : followSet [ symb ] ) {
-					ext::vector < ext::variant < alphabet::BottomOfTheStackSymbol, ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > > > > pop, push;
-
-					if ( ( size_t ) symb.getRank ( ) > 0 ) {
-						for ( const auto & e : symbFollowTuple )
-							pop.push_back ( e );
-						std::reverse ( pop.begin ( ), pop.end ( ) );
-					}
-
-					push.push_back( kv2.second );
-
-					if ( common::GlobalData::verbose ) {
-						common::Streams::err << "Transition 1" << ( pop.empty() ? "a" : "b" ) <<  ": " << symb.getSymbol ( ).first << " | " << std::endl <<
-							"\t" << pop << std::endl <<
-							"\t ->" << std::endl <<
-							"\t" << push << std::endl << std::endl;
-					}
-
-					automaton.addTransition ( q, phi ( symb ), pop, q, push );
-				}
-			}
-		}
-	}
-
-	// Final
-	for ( const common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > & symb : firstSet ) {
-		ext::vector < ext::variant < alphabet::BottomOfTheStackSymbol, ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > > > > pop;
-		pop.push_back ( ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > > { symb } );
-		pop.push_back ( BotS );
-		automaton.addTransition ( q, alphabet::EndSymbol ( ), pop, f, { } );
-	}
-	/* TRANSITIONS END */
-
-	return automaton;
-}
-
 auto ToPostfixPushdownAutomatonGlushkovFormalRTE = registration::AbstractRegister < ToPostfixPushdownAutomatonGlushkov,
-			automaton::NPDA < ext::variant < common::ranked_symbol < DefaultSymbolType, DefaultRankType >, alphabet::EndSymbol >, DefaultEpsilonType, ext::variant < alphabet::BottomOfTheStackSymbol, ext::set < common::ranked_symbol < ext::pair < object::Object, unsigned >, unsigned > > >, char >,
+			automaton::NPDA < ext::variant < common::ranked_symbol < DefaultSymbolType, DefaultRankType >, alphabet::EndSymbol >, DefaultEpsilonType, ext::variant < ext::set < common::ranked_symbol < ext::pair < DefaultSymbolType, unsigned >, DefaultRankType > >, alphabet::BottomOfTheStackSymbol >, char >,
 			const rte::FormalRTE < > & > ( ToPostfixPushdownAutomatonGlushkov::convert );
 
 } /* namespace convert */
diff --git a/alib2algo/src/rte/convert/ToPostfixPushdownAutomatonGlushkov.h b/alib2algo/src/rte/convert/ToPostfixPushdownAutomatonGlushkov.h
index a0a9387336087aa5170b81eb97ae2c3cc2122a9a..64289f293f01e74ab668f239391a6e3a5f9842b9 100644
--- a/alib2algo/src/rte/convert/ToPostfixPushdownAutomatonGlushkov.h
+++ b/alib2algo/src/rte/convert/ToPostfixPushdownAutomatonGlushkov.h
@@ -8,16 +8,21 @@
 #ifndef TO_POSTFIX_PUSHDOWN_AUTOMATON_GLUSHKOV_H_
 #define TO_POSTFIX_PUSHDOWN_AUTOMATON_GLUSHKOV_H_
 
-#include <automaton/PDA/NPDA.h>
-
-#include <rte/formal/FormalRTE.h>
-
-#include <alib/variant>
 #include <alib/set>
+#include <alib/variant>
+
+#include <global/GlobalData.h>
 
+#include <automaton/PDA/NPDA.h>
+#include <rte/formal/FormalRTE.h>
 #include <alphabet/BottomOfTheStackSymbol.h>
 #include <alphabet/EndSymbol.h>
 
+#include "../glushkov/GlushkovFollow.h"
+#include "../glushkov/GlushkovIndexate.h"
+#include "../glushkov/GlushkovFirst.h"
+#include "../glushkov/GlushkovSubstitutionMap.h"
+
 namespace rte {
 
 namespace convert {
@@ -37,7 +42,17 @@ private:
 	// --------------------------------------------------------------------
 
 	template < class SymbolType, class RankType >
-	static bool isSubstSymbolPresent ( const ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > > & container, const TAlphabet < SymbolType, RankType > & substAlphabet );
+	static common::ranked_symbol < SymbolType, RankType > phi ( const common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > & symbol ) {
+		return common::ranked_symbol < SymbolType, RankType > ( symbol.getSymbol ( ).first, symbol.getRank ( ) );
+	}
+
+	template < class SymbolType, class RankType >
+	static bool isSubstSymbolPresent ( const ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > > & container, const TAlphabet < SymbolType, RankType > & substAlphabet ) {
+		ext::vector < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > > intersection;
+		std::set_intersection ( container.begin ( ), container.end ( ), substAlphabet.begin ( ), substAlphabet.end ( ), std::back_inserter ( intersection ) );
+		return intersection.size ( ) > 0;
+	}
+
 
 public:
 	/**
@@ -51,9 +66,205 @@ public:
 	 * \return real-time height-determinitic pushdown automaton accepting the language described by the original regular tree expression
 	 */
 	template < class SymbolType, class RankType >
-	static automaton::NPDA < ext::variant < common::ranked_symbol < SymbolType, RankType >, alphabet::EndSymbol >, DefaultEpsilonType, ext::variant < alphabet::BottomOfTheStackSymbol, ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > > >, char > convert ( const rte::FormalRTE < > & rte );
+	static automaton::NPDA < ext::variant < common::ranked_symbol < SymbolType, RankType >, alphabet::EndSymbol >, DefaultEpsilonType, ext::variant < ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > >, alphabet::BottomOfTheStackSymbol >, char > convert ( const rte::FormalRTE < SymbolType, RankType > & rte );
 };
 
+template < class SymbolType, class RankType >
+automaton::NPDA < ext::variant < common::ranked_symbol < SymbolType, RankType >, alphabet::EndSymbol >, DefaultEpsilonType, ext::variant < ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > >, alphabet::BottomOfTheStackSymbol >, char > ToPostfixPushdownAutomatonGlushkov::convert ( const rte::FormalRTE < SymbolType, RankType > & rte ) {
+
+	 // step 1; index RTE
+	rte::FormalRTE < ext::pair < SymbolType, unsigned >, RankType > indexedRTE = rte::GlushkovIndexate::index ( rte );
+
+	 // step 2; compute:
+	 // - first set
+	const ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > > firstSet = rte::GlushkovFirst::first ( indexedRTE );
+
+	 // - follow set for every element of (non-indexed) RTE alphabet element
+	const ext::map < const rte::FormalRTEElement < ext::pair < SymbolType, unsigned >, RankType >*, ext::map < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType >, ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > > > > substMapTree = GlushkovSubstitutionMap::substMap ( indexedRTE );
+	ext::map < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType >, ext::set < GlushkovFollow::TFollowTuple < SymbolType, RankType > > > followSet;
+
+	for ( const common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > & symbol : indexedRTE.getAlphabet ( ) )
+		followSet.insert ( std::make_pair ( symbol, rte::GlushkovFollow::follow ( indexedRTE, symbol, substMapTree ) ) );
+
+	/* check for exceptions -> there must be NO substitution symbol in first set */
+	if ( isSubstSymbolPresent ( firstSet, indexedRTE.getSubstitutionAlphabet ( ) ) )
+		throw exception::CommonException ( "GlushkovRTE: Substitution symbol appeared in the first set" );
+	/* check end */
+
+	/* check for exceptions -> there must be NO substitution symbol in follow sets */
+	for ( const std::pair < const common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType >, ext::set < GlushkovFollow::TFollowTuple < SymbolType, RankType > > > & kv : followSet )
+		for ( const GlushkovFollow::TFollowTuple < SymbolType, RankType > & followTuple : kv.second ) // TFollowTuple = vector < set < ranked_symbol > >
+			for ( const ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > > & followTupleElem : followTuple )
+				if ( isSubstSymbolPresent ( followTupleElem, indexedRTE.getSubstitutionAlphabet ( ) ) )
+					throw exception::CommonException ( "GlushkovRTE: Substitution symbol appeared in a follow set" );
+	/* check end */
+
+	 // step 3; create PDA (w/o transitions yet) and initialize input alphabet = (non-indexed) RTE alphabet and END symbol
+	char q = 'q';
+	char f = 'f';
+
+	auto BotS = ext::variant < ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > >, alphabet::BottomOfTheStackSymbol >::template from < alphabet::BottomOfTheStackSymbol > ( );
+	automaton::NPDA < ext::variant < common::ranked_symbol < SymbolType, RankType >, alphabet::EndSymbol >, DefaultEpsilonType, ext::variant < ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > >, alphabet::BottomOfTheStackSymbol >, char > automaton ( q, BotS );
+
+	automaton.addState ( f );
+	automaton.addFinalState ( f );
+
+	for ( const common::ranked_symbol < SymbolType, RankType > & symbol : rte.getAlphabet ( ) )
+		automaton.addInputSymbol ( symbol );
+
+	automaton.addInputSymbol ( alphabet::EndSymbol { } );
+
+	// step 4; create pushdown store alphabet;
+
+	// simple
+	for ( const common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > & symb : indexedRTE.getAlphabet ( ) )
+		automaton.addPushdownStoreSymbol ( ext::variant < ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > >, alphabet::BottomOfTheStackSymbol > ( { symb } ) );
+
+	// complex
+	for ( const std::pair < const rte::FormalRTEElement < ext::pair < SymbolType, unsigned >, RankType >* const, ext::map < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType >, ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > > > > & kv : substMapTree ) {
+		if ( dynamic_cast < const rte::FormalRTESymbolSubst < ext::pair < SymbolType, unsigned >, RankType > * const > ( kv.first ) ) {
+			for ( const std::pair < common::ranked_symbol < ext::pair < SymbolType, unsigned > >, ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned > > > > & kv2 : kv.second ) {
+				automaton.addPushdownStoreSymbol ( kv2.second );
+			}
+		}
+	}
+
+	/* DEBUG */
+	if ( common::GlobalData::verbose ) {
+		common::Streams::err << "RTE:" << std::endl;
+		for ( const auto & symbol : indexedRTE.getAlphabet ( ) )
+			common::Streams::err << "\t" << symbol << std::endl;
+		common::Streams::err << std::endl;
+
+		common::Streams::err << "First(RTE):" << std::endl;
+		for ( const auto & symbol : firstSet )
+			common::Streams::err << "\t" << symbol << std::endl;
+		common::Streams::err << std::endl;
+
+		common::Streams::err << "subMap:" << std::endl;
+			// const ext::map <
+			//   const rte::FormalRTEElement < SymbolType, RankType >*,
+			//   ext::map < common::ranked_symbol < >, ext::set < common::ranked_symbol < > > > >
+			// substMapTree = GlushkovSubstitutionMap::substMap ( indexedRTE );
+		for ( const auto & nodes : substMapTree ) {
+			common::Streams::err << *nodes.first << std::endl;
+			for ( const auto & mapping : nodes.second ) {
+				common::Streams::err << "\t" << mapping.first << " -> " << std::endl;
+				for ( const auto & elem : mapping.second )
+					common::Streams::err << "\t\t" << elem << std::endl;
+			}
+		}
+		common::Streams::err << std::endl;
+
+		// ext::map < common::ranked_symbol < >, ext::set < GlushkovFollow::TFollowTuple < SymbolType, RankType > > > followSet;
+		for ( const std::pair < const common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType >, ext::set < GlushkovFollow::TFollowTuple < SymbolType, RankType > > >& kv : followSet ) {
+			common::Streams::err << "Follow(RTE, " << kv.first << "):" << std::endl;
+
+			if ( kv.second.empty ( ) )
+				common::Streams::err << "\t" << "{}" << std::endl;
+
+			for ( const GlushkovFollow::TFollowTuple < SymbolType, RankType > & followTuple : kv.second ) { // TFollowTuple = vector < set < ranked_symbol > >
+				common::Streams::err << " \t - FollowTuple:" << std::endl;
+				for ( const ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > > & child : followTuple )
+					common::Streams::err << "\t\t - " << child << std::endl;
+
+				common::Streams::err << std::endl;
+			}
+
+			common::Streams::err << std::endl;
+		}
+
+		common::Streams::err << "---------------------------------------------------------" << std::endl;
+		common::Streams::err << "PDA:" << std::endl;
+		common::Streams::err << "pds symbols" << std::endl;
+
+		for ( const auto & symb : automaton.getPushdownStoreAlphabet ( ) )
+			common::Streams::err << "\t" << symb << std::endl;
+		common::Streams::err << std::endl;
+	}
+	/* DEBUG END */
+
+	/* TRANSITIONS */
+	// Pattern 3 and 2
+	for ( const common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > & symb : indexedRTE.getAlphabet ( ) ) {
+		if ( symb.getRank ( ) == unsigned ( 0 ) ) {
+			ext::vector < ext::variant < ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > >, alphabet::BottomOfTheStackSymbol > > push;
+			push.push_back ( ext::variant < ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > >, alphabet::BottomOfTheStackSymbol > ( { symb } ) );
+
+			if ( common::GlobalData::verbose ) {
+				common::Streams::err << "Transition 3: " << symb.getSymbol ( ).first << " | " << std::endl <<
+					"\t" << "[]" << std::endl <<
+					"\t ->" << std::endl <<
+					"\t" << push << std::endl << std::endl;
+			}
+			automaton.addTransition ( q, phi ( symb ), { }, q, push );
+		} else {
+			for ( const GlushkovFollow::TFollowTuple < SymbolType, RankType > & followTuple : followSet [ symb ] ) { //tuple = vector < set < symb > >
+				ext::vector < ext::variant < ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > >, alphabet::BottomOfTheStackSymbol > > pop, push;
+
+				for ( const auto & e : followTuple )
+				   pop.push_back ( e );
+				std::reverse ( pop.begin ( ), pop.end ( ) );
+
+				push.push_back( ext::variant < ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > >, alphabet::BottomOfTheStackSymbol > ( { symb } ) );
+
+				if ( common::GlobalData::verbose ) {
+					common::Streams::err << "Transition 2: " << symb.getSymbol ( ).first << " | " << std::endl <<
+						"\t" << pop << std::endl <<
+						"\t ->" << std::endl <<
+						"\t" << push << std::endl << std::endl;
+				}
+				automaton.addTransition ( q, phi ( symb ), pop, q, push );
+			}
+		}
+	}
+
+	// Pattern 1
+	for ( const common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > & symb : indexedRTE.getAlphabet ( ) ) {
+		for ( const std::pair < const rte::FormalRTEElement < ext::pair < SymbolType, unsigned >, RankType >* const, ext::map < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType >, ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > > > > & kv : substMapTree ) {
+			if ( dynamic_cast < const rte::FormalRTESymbolSubst < ext::pair < SymbolType, unsigned >, RankType > * const > ( kv.first ) == nullptr ) // not a SubstSymbol node
+				continue;
+
+			for ( const std::pair < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType >, ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > > > & kv2 : kv.second ) {
+				if ( kv2.second.count ( symb ) == 0 )
+					continue;
+
+				for ( const GlushkovFollow::TFollowTuple < SymbolType, RankType > & symbFollowTuple : followSet [ symb ] ) {
+					ext::vector < ext::variant < ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > >, alphabet::BottomOfTheStackSymbol > > pop, push;
+
+					if ( ( size_t ) symb.getRank ( ) > 0 ) {
+						for ( const auto & e : symbFollowTuple )
+							pop.push_back ( e );
+						std::reverse ( pop.begin ( ), pop.end ( ) );
+					}
+
+					push.push_back( kv2.second );
+
+					if ( common::GlobalData::verbose ) {
+						common::Streams::err << "Transition 1" << ( pop.empty() ? "a" : "b" ) <<  ": " << symb.getSymbol ( ).first << " | " << std::endl <<
+							"\t" << pop << std::endl <<
+							"\t ->" << std::endl <<
+							"\t" << push << std::endl << std::endl;
+					}
+
+					automaton.addTransition ( q, phi ( symb ), pop, q, push );
+				}
+			}
+		}
+	}
+
+	// Final
+	for ( const common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > & symb : firstSet ) {
+		ext::vector < ext::variant < ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > >, alphabet::BottomOfTheStackSymbol > > pop;
+		pop.push_back ( ext::set < common::ranked_symbol < ext::pair < SymbolType, unsigned >, RankType > > { symb } );
+		pop.push_back ( BotS );
+		automaton.addTransition ( q, alphabet::EndSymbol ( ), pop, f, { } );
+	}
+	/* TRANSITIONS END */
+
+	return automaton;
+}
+
 } /* namespace convert */
 
 } /* namespace rte */