Index: /library/bdm/bdmroot.cpp
===================================================================
--- /library/bdm/bdmroot.cpp (revision 907)
+++ /library/bdm/bdmroot.cpp (revision 942)
@@ -4,14 +4,4 @@
 namespace bdm {
 	
-	//! a general utility transforming a comma-separated sequence of strings into an instance of Array<strings>
-	Array<string> log_level_base::string2Array( const string &input )
-	{
-		string result = input;
-		string::size_type loc;
-		while( loc = result.find( ',' ), loc != string::npos )
-			result[loc] = ' ';
-		return Array<string>("{ " + result + " }" );
-	}
-
 	void UI_DBG (const  Setting &S, const string &spc, ostream &out =cout){
 		const char *Name=S.getName();
Index: /library/bdm/bdmroot.h
===================================================================
--- /library/bdm/bdmroot.h (revision 915)
+++ /library/bdm/bdmroot.h (revision 942)
@@ -41,43 +41,4 @@
 //! Forward class declaration
 class logger;
-
-//! base class for all log_levels
-//!
-//! the existence of this class is forced by the necessity of passing log_levels to user_info methods, however, the main functionality
-//! is located in \c log_level_template class
-class log_level_base {
-private:
-	// UserInfo class have to be able to read all the internal 
-	// attributes to be able to write/read log_level to/from a Setting structure
-	friend class UI;
-
-	//! this is necessary to allow logger to set ids vector appropriately and also to set registered_logger
-	friend class logger; 
-
-protected:
-	//! boolean flags related indicating which details will be logged to a logger
-	bitset<32> values;
-	
-	//! vector of vectors of log IDs - one element for each entry and multiple entries can be stored on the position of one enum
-	Vec<ivec> ids;
-
-	//! internal pointer to the logger to which this log_level is registered
-	//! 
-	//! it is set to NULL at the beginning
-	logger * registered_logger;
-
-public:
-	//! default constructor
-	log_level_base() {
-		registered_logger = NULL;
-	}
-
-
-	//! a general utility transforming a comma-separated sequence of strings into an instance of Array<strings>
-	static Array<string> string2Array( const string &input );
-
-	//! string equivalents of the used enumerations which are filled with a help of #LOG_LEVEL macro within class T
-	virtual const Array<string> &names() const = 0;
-};
 
 //! Root class of BDM objects
Index: /library/bdm/base/user_info.h
===================================================================
--- /library/bdm/base/user_info.h (revision 927)
+++ /library/bdm/base/user_info.h (revision 942)
@@ -228,4 +228,136 @@
 };
 
+
+//! This class stores the details which will be logged to a logger
+//!
+//! This is only the first part of the whole declaration, which has to be however separated into
+//! two different classes for allowing the compilation of source code. For more details
+//! see logger::add_setting(...) method and mainly log_level_template<T>::template<class U> void store( const enum T::log_level_enums log_level_enum, const U data ) const
+//! method. For the reason the second one is templated, it was necessary to declare this whole class. 
+template<class T> class log_level_base : public root {
+private:
+	//! this is necessary to allow logger to set ids vector appropriately and also to set registered_logger
+	friend class logger; 
+
+protected:
+	//! boolean flags related indicating which details will be logged to a logger
+	bitset<32> values;
+	
+	//! vector of vectors of log IDs - one element for each entry and multiple entries can be stored on the position of one enum
+	Vec<ivec> ids;
+
+	//! internal pointer to the logger to which this log_level is registered
+	//! 
+	//! it is set to NULL at the beginning
+	logger * registered_logger;
+
+public:
+
+	//! default constructor
+	log_level_base( ) {
+		registered_logger = NULL;
+		int len = names().length();
+		ids.set_size( len );
+		for( int i = 0; i<len; i++ )
+		{
+			ids(i).set_size ( 1 );
+			ids(i) = -1;
+		}
+	}
+
+	//! a general utility transforming a comma-separated sequence of strings into an instance of Array<strings>
+	static Array<string> string2Array( const string &input )
+	{
+		string result = input;
+		string::size_type loc;
+		while( loc = result.find( ',' ), loc != string::npos )
+			result[loc] = ' ';
+		return Array<string>("{ " + result + " }" );
+	}
+
+
+
+	//! Set log_levels according to the Setting element
+	void from_setting ( const Setting &element )
+	{
+		string raw_log_level;
+		UI::get( raw_log_level, element );
+		Array<string> loaded_log_level = log_level_base::string2Array( raw_log_level );
+	
+		values.reset();
+
+		for( int i = 0; i < loaded_log_level.length(); i++ )
+			for( int j = 0; j < names().length(); j++ ){
+				if( loaded_log_level(i) == names()(j)  ) 
+				{
+					values[j] = true;
+					break;
+				} 
+			}
+	}
+
+	//! Store log_levels into the Setting element
+	void to_setting ( Setting &element ) const 
+	{
+		// HERE WE WANT NOT TO DELETE PREVIOUS DATA STORED BY OTHER LOG_LEVELS, SEE SPECIAL IMPLEMENTATION OF UI::GET(...) FOR THIS CLASS
+		string string_to_write =  ( const char* ) element;
+
+		for( unsigned int i = 0; i < values.size(); i++ )
+			if( values[i] ) 
+			{
+				if( string_to_write.length() > 0 )
+					string_to_write = string_to_write + ',';
+				string_to_write = string_to_write + names()(i);
+			}
+			
+		element = string_to_write;
+	}
+
+	//! this method adds new id to its proper position and return the name of this position
+	string store_id_and_give_name( enum T::log_level_enums const log_level_enum,  int enum_subindex, int id ) {
+		if( ids(log_level_enum).length() <= enum_subindex )
+			ids(log_level_enum).set_size( enum_subindex+1, true );
+		ids(log_level_enum)(enum_subindex) = id; 
+
+		// here we remove a "log" prefix from name, i.e., for instance it transforms "logevidence" to "evidence"
+		ostringstream stream;
+		string name_with_prefix = names()(log_level_enum);
+		string possible_log_prefix = name_with_prefix.substr(0,3);
+		if( possible_log_prefix == "log" )
+			stream << name_with_prefix.substr(3,name_with_prefix.length()-3);
+		else 
+			stream << name_with_prefix;
+
+		// add number to name only in the case there are more registered vectors with the same log_level_enum
+		if( ids(log_level_enum).length() > 1 )
+			stream << "*" << enum_subindex;
+		
+		return stream.str();
+	}
+
+	//! string equivalents of the used enumerations which are filled with a help of #LOG_LEVEL macro within class T
+	const Array<string> &names() const
+	{
+		return T::log_level_names();
+	}
+
+	//! read only operator for testing individual fields of log_level
+	//!
+	//! it is necessary to acces it with a proper enumeration type, thus this approach is type-safe
+	bool operator [] (const enum T::log_level_enums &log_level_enum ) const
+	{
+		return values[log_level_enum];
+	}
+
+	//! operator for setting an individual field of log_level 
+	//!
+	//! it is necessary to acces it with a proper enumeration type, thus this approach is type-safe
+	bitset<32>::reference operator [] (const enum T::log_level_enums &log_level_enum )
+	{
+		return values[log_level_enum];
+	}
+};
+//UIREGISTER IS FORBIDDEN FOR THIS CLASS,  AS IT SHOULD BE LOADED ONLY THROUGH THE SPECIALIZED UI::GET(...) METHOD
+
 /*!
 @brief UI is an abstract class which collects all the auxiliary functions useful to prepare some concrete
@@ -292,4 +424,10 @@
 	static const Setting& to_child_setting ( const Setting &element, const string &name );
 
+	//! A shortcut for calling instance.from_setting( set ); with some error catches added
+	static void call_from_setting( root &instance, const Setting &set, string class_name = "unknown");
+
+	//! A shortcut for calling instance.to_setting( set ); with some error catches added
+	static void call_to_setting( const root &instance, Setting &set, string class_name = "unknown" );
+
 	//! This method converts a Setting into a matrix
 	static void from_setting ( mat& matrix, const Setting &element );
@@ -304,7 +442,6 @@
 	//! This method converts a Setting into a real scalar	
 	static void from_setting ( double &real, const Setting &element );
-	//! This method converts a Setting into a log_level variant and initialize options properly
-	static void from_setting ( log_level_base &log_level, const Setting &element );
-
+	//! This method converts a Setting into a class T descendant
+	static void from_setting ( root &instance, const Setting &element );
 	//! This method converts a Setting into a class T descendant
 	template<class T> static void from_setting ( T* &instance, const Setting &element ) {
@@ -330,20 +467,5 @@
 
 		try {
-			instance->from_setting ( link.result );
-		} catch ( SettingException &sttng_xcptn ) {
-			delete instance;
-			instance = 0;
-			string msg = "UIException: method ";
-			msg += class_name;
-			msg += ".from_setting(Setting&) has thrown a SettingException.";
-			throw UISettingException ( msg, sttng_xcptn.getPath() );
-		} catch ( std::runtime_error &e ) {
-			delete instance;
-			instance = 0;
-			string msg = "UIException: method ";
-			msg += class_name;
-			msg += " says: ";
-			msg += e.what();
-			throw UISettingException ( msg, link.result );
+			call_from_setting( *instance, link.result, class_name );
 		} catch ( ... ) {
 			delete instance;
@@ -351,13 +473,9 @@
 			throw;
 		}
-
-		// validate the new instance
-		instance->validate();
 	}
 
 	//! This method converts a Setting into a descendant of class
 	//! T, wrapped in an instance of bdm::shared_ptr<T> .
-	template<class T>
-	static void from_setting ( bdm::shared_ptr<T> &instance, const Setting &element ) {
+	template<class T> static void from_setting ( bdm::shared_ptr<T> &instance, const Setting &element ) {
 		T *tmp_inst = 0;
 		from_setting ( tmp_inst, element );
@@ -372,5 +490,4 @@
 		assert_type ( link.result, Setting::TypeList );
 
-
 		int len = link.result.getLength();
 		array_to_load.set_length ( len );
@@ -380,20 +497,4 @@
 			from_setting ( array_to_load ( i ), link.result[i] );
 	}
-/*
-	//! This is dummy version of the from_setting method for other, unsupported types. It just throws an exception.
-	//!
-	//! At the moment, this is the only way how to compile the library without obtaining the compiler error c2665.
-	//! The exception can help to find the place where the template is misused and also to correct it.
-	template<class T> static void from_setting ( T &variable_to_load, const Setting &element ) {
-		std::string msg = "UIException: from_setting is not implemented for type ";
-		try{
-			variable_to_load.from_setting(element);
-		} catch (...){
-			msg += typeid ( T ).name();
-			msg += '.';
-			throw UISettingException ( msg, element );
-		}
-	}
-*/
 
 protected:
@@ -414,5 +515,5 @@
 	//! The new instance of type T* is constructed and initialized with values stored in the Setting element[name]
 	//!
-	//! If there is not any sub-element named #name and settingPresence is #optional, an empty bdm::shared_ptr<T> is returned. When settingPresence is #compulsory, the returned bdm::shared_ptr<T> is never empty (an exception is thrown when the object isn't found).
+	//! If there does not exist any sub-element named #name and settingPresence is #optional, an empty bdm::shared_ptr<T> is returned. When settingPresence is #compulsory, the returned bdm::shared_ptr<T> is never empty (an exception is thrown when the object isn't found).
 	template<class T>
 	static bdm::shared_ptr<T> build ( const Setting &element, const string &name, SettingPresence settingPresence = optional ) {
@@ -431,5 +532,5 @@
 	//! The new instance of type T* is constructed and initialized with values stored in the Setting element[index]
 	//!
-	//! If there is not any sub-element indexed by #index, and settingPresence is #optional, an empty bdm::shared_ptr<T> is returned. When settingPresence is #compulsory, the returned bdm::shared_ptr<T> is never empty (an exception is thrown when the object isn't found).
+	//! If there does not exist  any sub-element indexed by #index, and settingPresence is #optional, an empty bdm::shared_ptr<T> is returned. When settingPresence is #compulsory, the returned bdm::shared_ptr<T> is never empty (an exception is thrown when the object isn't found).
 	template<class T>
 	static bdm::shared_ptr<T> build ( const Setting &element, const int index, SettingPresence settingPresence = optional ) {
@@ -466,5 +567,5 @@
 
 	//! The existing instance of type T is initialized with values stored in the Setting element[name]
-	//! If there is not any sub-element named #name, this method returns false.
+	//! If there does not exist any sub-element named #name, this method returns false.
 	template<class T> static bool get ( T &instance, const Setting &element, const string &name, SettingPresence settingPresence = optional ) {
 		if ( !element.exists ( name ) ) {
@@ -480,5 +581,5 @@
 
 	//! The existing instance of type T is initialized with values stored in the Setting element[index]
-	//! If there is not any sub-element indexed by #index, this method returns false.
+	//! If there does not exist any sub-element indexed by #index, this method returns false.
 	template<class T> static bool get ( T &instance, const Setting &element, const int index, SettingPresence settingPresence = optional ) {
 		if ( element.getLength() <= index ) {
@@ -551,27 +652,13 @@
 	//! or by its integer index. In that case, the new element is added at the very end of the current list of child Settings.
 
-	//! A root descendant instance is stored in the new child Setting appended to the passed element
-	template< class T> static void save ( const T * const instance, Setting &element, const string &name = "" ) {
-		Setting &set = ( name == "" ) ?  (element.getType()==Setting::TypeArray || element.getType()==Setting::TypeList) ? element.add ( Setting::TypeGroup ) : element 
-		               : element.add ( name, Setting::TypeGroup );
-
-		const string &class_name = MappedUI::retrieve_class_name ( &typeid ( *instance ) );
-
-		// add attribute "class"
-		Setting &type = set.add ( "class", Setting::TypeString );
-		type = class_name;
-
-		try {
-			instance->to_setting ( set );
-		} catch ( SettingException &sttng_xcptn ) {
-			string msg = "UIException: method ";
-			msg += class_name;
-			msg += ".to_setting(Setting&) has thrown a SettingException.";
-			throw UISettingException ( msg, sttng_xcptn.getPath() );
-		}
-	}
-
+	//! A root descendant is stored in the new child Setting appended to the passed element
+	static void save ( const root &instance, Setting &element, const string &name = "" );
+
+	//! A pointer to root descendant is stored in the new child Setting appended to the passed element
+	static void save ( const root * const instance, Setting &element, const string &name = "" );
+
+	//! A shared pointer to root descendant is stored in the new child Setting appended to the passed element
 	template< class T> static void save ( const bdm::shared_ptr<T> &instance, Setting &element, const string &name = "" ) {
-		save<T> ( instance.get(), element, name );
+		save( instance.get(), element, name );
 	}
 
@@ -603,11 +690,20 @@
 	static void save ( const double &real, Setting &element, const string &name = "" );
 
-// The only difference from classical UserInfo approach to log_level_template is the fact
-	// that the actual UI element related to log_level_template could possibly exists yet. In this case, 
-	// we do not want to throw an exception like in the case of any other type being loaded
-	// from Setting. We rather fill the current log_level into this existig element. This way, it is 
-	// possible that more instances of log_level_template class (templated with different classes)
+    // The only difference from classical UserInfo approach here is the fact
+	// that the actual UI element related to log_level_base could possibly exists yet. In this case, 
+	// we do not want to throw an exception as usually. We rather append current data into the existig element. This way, it is 
+	// possible that more instances of log_level_base  (templated with different classes)
 	// can be stored in only one line in a configuration file
-	static void save ( const log_level_base &log_level, Setting &element, const string &name = "log_level"  );
+	template<class T> static void save ( const log_level_base<T> &log_level, Setting &element ) {
+		assert_type ( element, Setting::TypeGroup );		
+		string name = "log_level";
+		
+		if( element.exists( name ) ) 
+			assert_type ( element[name], Setting::TypeString );
+		else
+			element.add ( name, Setting::TypeString ); 
+
+		log_level.to_setting( element[name] );
+	}
 
 	//!@}
Index: /library/bdm/base/bdmbase.h
===================================================================
--- /library/bdm/base/bdmbase.h (revision 927)
+++ /library/bdm/base/bdmbase.h (revision 942)
@@ -296,70 +296,4 @@
 RV concat ( const RV &rv1, const RV &rv2 );
 
-
-//! This class stores a details that will be logged to a logger
-//!
-//! This is only the first part of the whole declaration, which has to be however separated into
-//! two different classes for allowing the compilation of source code. For more details
-//! see logger::add_setting(...) method and mainly log_level_template<T>::template<class U> void store( const enum T::log_level_enums log_level_enum, const U data ) const
-//! method. For the reason the second one is templated, it was necessary to declare this whole class. 
-template<class T> class log_level_intermediate : public log_level_base {
-public:
-	//! this method adds new id to its proper position and return the name of this position
-	string store_id_and_give_name( enum T::log_level_enums const log_level_enum,  int enum_subindex, int id ) {
-//		int ids_len = ids(log_level_enum).length(); <== compiler suggest to remove
-		if( ids(log_level_enum).length() <= enum_subindex )
-			ids(log_level_enum).set_size( enum_subindex+1, true );
-		ids(log_level_enum)(enum_subindex) = id; 
-
-		// here we remove a "log" prefix from name, i.e., for instance it transforms "logevidence" to "evidence"
-		ostringstream stream;
-		string name_with_prefix = names()(log_level_enum);
-		string possible_log_prefix = name_with_prefix.substr(0,3);
-		if( possible_log_prefix == "log" )
-			stream << name_with_prefix.substr(3,name_with_prefix.length()-3);
-		else 
-			stream << name_with_prefix;
-
-		// add number to name only in the case there are more registered vectors with the same log_level_enum
-		if( ids(log_level_enum).length() > 1 )
-			stream << "*" << enum_subindex;
-		
-		return stream.str();
-	}
-
-	log_level_intermediate( ) {
-		int len = names().length();
-		ids.set_size( len );
-		for( int i = 0; i<len; i++ )
-		{
-			ids(i).set_size ( 1 );
-			ids(i) = -1;
-		}
-	}
-
-	//! string equivalents of the used enumerations which are filled with a help of #LOG_LEVEL macro within class T
-	const Array<string> &names() const
-	{
-		return T::log_level_names();
-	}
-
-	//! read only operator for testing individual fields of log_level
-	//!
-	//! it is necessary to acces it with a proper enumeration type, thus this approach is type-safe
-	bool operator [] (const enum T::log_level_enums &log_level_enum ) const
-	{
-		return values[log_level_enum];
-	}
-
-	//! operator for setting an individual field of log_level 
-	//!
-	//! it is necessary to acces it with a proper enumeration type, thus this approach is type-safe
-	bitset<32>::reference operator [] (const enum T::log_level_enums &log_level_enum )
-	{
-		return values[log_level_enum];
-	}
-};
-
-
 /*!
 @brief Class for storing results (and semi-results) of an experiment
@@ -417,5 +351,5 @@
 	//! 
 	//! passing the last parameter \c enum_subindex one can store multiple vectors in the position of one enum
-	template<class T> void add_vector ( log_level_intermediate<T> &log_level, enum T::log_level_enums const log_level_enum, const RV &rv, const string &prefix, int enum_subindex = 0 )
+	template<class T> void add_vector ( log_level_base<T> &log_level, enum T::log_level_enums const log_level_enum, const RV &rv, const string &prefix, int enum_subindex = 0 )
 	{
 		if( !log_level.registered_logger )
@@ -439,5 +373,5 @@
 	//! It also sets a pointer to logger or justify it is correctly assigned from previous call to this procedure 
 	//!
-	//! To allow both arguments log_level and log_level_enum be templated, it was necessary to declare log_level_intermediate<T> class.
+	//! To allow both arguments log_level and log_level_enum be templated, it was necessary to declare log_level_base<T> class.
 	//! This way we check compatibility of the passed log_level and log_level_enum, which would be impossible using just log_level_base class
 	//! here. 
@@ -445,5 +379,5 @@
 	//!
 	//! passing the last parameter \c enum_subindex one can store multiple settings in the position of one enum
-	template<class T> void add_setting ( log_level_intermediate<T> &log_level, enum T::log_level_enums const log_level_enum,  const string &prefix, int enum_subindex = 0 ) {
+	template<class T> void add_setting ( log_level_base<T> &log_level, enum T::log_level_enums const log_level_enum,  const string &prefix, int enum_subindex = 0 ) {
 		if( !log_level.registered_logger )
 			log_level.registered_logger = this;
@@ -471,5 +405,5 @@
 
 //! This class stores a details that will be logged to a logger
-template<class T> class log_level_template : public log_level_intermediate<T> {
+template<class T> class log_level_template : public log_level_base<T> {
 public:
 	//! This method stores a vector to the proper place in registered logger 
@@ -499,8 +433,7 @@
 	//! If this method was not templated, we could store whole body of this class in cpp file without explicitly touching registered_logger->log_setting(...) here.
 	//! (it would not be straightforward, though, still there are some enums which had to be converted into integers but it could be done without loosing type control)
-	//! This way, it would not be necessary to declare log_level_intermediate<T> class and we could declare log_level_template<T>
+	//! This way, it would not be necessary to declare log_level_base<T> class and we could declare log_level_template<T>
 	//! before the logger class itself with a mere foroward declaration of logger. In our case, however, touching of registered_logger->log_setting
-	//! implies that friend declaration is not enough and we are lost in a circle. And just by cutting this circle we obtains log_level_intermediate<T> class. 
-	//! Howg.)
+	//! implies that forward declaration is not enough and we are lost in a circle. And just by cutting this circle we obtains log_level_base<T> class. 
 	template<class U> void store( const enum T::log_level_enums log_level_enum, const U data, int enum_subindex = 0 ) const
 	{			
@@ -526,5 +459,5 @@
   \ref ui
 */
-#define LOG_LEVEL(classname,...) public: enum log_level_enums { __VA_ARGS__ }; log_level_template<classname> log_level; private: friend class log_level_template<classname>; friend class log_level_intermediate<classname>; static const Array<string> &log_level_names() { static const Array<string> log_level_names = log_level_base::string2Array( #__VA_ARGS__ ); return log_level_names; }
+#define LOG_LEVEL(classname,...) public: enum log_level_enums { __VA_ARGS__ }; log_level_template<classname> log_level; private: friend class log_level_template<classname>; friend class log_level_base<classname>; static const Array<string> &log_level_names() { static const Array<string> log_level_names = log_level_base<classname>::string2Array( #__VA_ARGS__ ); return log_level_names; }
 
 
Index: /library/bdm/base/user_info.cpp
===================================================================
--- /library/bdm/base/user_info.cpp (revision 907)
+++ /library/bdm/base/user_info.cpp (revision 942)
@@ -176,4 +176,34 @@
 }
 
+void UI::call_to_setting( const root &instance, Setting &set, string class_name ) {
+	try {
+		instance.to_setting ( set );
+	} catch ( SettingException &sttng_xcptn ) {
+		string msg = "UIException: method ";
+		msg += class_name;
+		msg += ".to_setting(Setting&) has thrown a SettingException.";
+		throw UISettingException ( msg, sttng_xcptn.getPath() );
+	}
+}
+
+void UI::save ( const root &instance, Setting &element, const string &name ) {
+	Setting &set = ( name == "" ) ?  (element.getType()==Setting::TypeArray || element.getType()==Setting::TypeList) ? element.add ( Setting::TypeGroup ) : element 
+		            : element.add ( name, Setting::TypeGroup );
+
+	call_to_setting( instance, set );
+}
+
+void UI::save ( const root * const instance, Setting &element, const string &name ) {
+	Setting &set = ( name == "" ) ?  (element.getType()==Setting::TypeArray || element.getType()==Setting::TypeList) ? element.add ( Setting::TypeGroup ) : element 
+		            : element.add ( name, Setting::TypeGroup );
+
+	// add attribute "class"
+	const string &class_name = MappedUI::retrieve_class_name ( &typeid ( *instance ) );
+	Setting &type = set.add ( "class", Setting::TypeString );
+	type = class_name;
+
+	call_to_setting( *instance, set, class_name );
+}
+
 void UI::save ( const int &integer, Setting &element, const string &name ) {
 	Setting &set = ( name == "" ) ? element.add ( Setting::TypeInt )
@@ -235,28 +265,29 @@
 }
 
-void UI::save ( const log_level_base &log_level, Setting &element, const string &name ) {
-	assert_type ( element, Setting::TypeGroup );
-
-	string string_to_write;
-
-	Setting *list;
-	if( element.exists( name ) ) 
-	{
-		list = &element[name];
-		assert_type ( *list, Setting::TypeString );
-		string_to_write = ( const char* ) *list;
-	}
-	else
-		list = &element.add ( name, Setting::TypeString ); 
-
-	for( unsigned int i = 0; i < log_level.values.size(); i++ )
-		if( log_level.values[i] ) // a jeste zkontrolovat zda to jmeno uz neni obsazeno? 
-		{
-			if( string_to_write.length() > 0 )
-				string_to_write = string_to_write + ',';
-			string_to_write = string_to_write + log_level.names()(i);
-		}
-			
-	*list = string_to_write;
+
+void UI::call_from_setting( root &instance, const Setting &set, string class_name) {
+	try {
+		instance.from_setting ( set );
+	} catch ( SettingException &sttng_xcptn ) {
+		string msg = "UIException: method ";
+		msg += class_name;
+		msg += ".from_setting(Setting&) has thrown a SettingException.";
+		throw UISettingException ( msg, sttng_xcptn.getPath() );
+	} catch ( std::runtime_error &e ) {
+		string msg = "UIException: method ";
+		msg += class_name;
+		msg += " says: ";
+		msg += e.what();
+		throw UISettingException ( msg, set );
+	} 
+
+	// validate the new instance
+	instance.validate();	
+}
+
+void UI::from_setting ( root &instance, const Setting &element ) {
+	const SettingResolver link ( element );
+	assert_type( link.result, Setting::TypeGroup );
+	call_from_setting( instance, link.result );
 }
 
@@ -393,21 +424,3 @@
 }
 
-void UI::from_setting ( log_level_base &log_level, const Setting &element )
-{
-	string raw_log_level;
-	UI::get( raw_log_level, element );
-	Array<string> loaded_log_level = log_level_base::string2Array( raw_log_level );
-	
-	log_level.values.reset();
-
-	for( int i = 0; i < loaded_log_level.length(); i++ )
-		for( int j = 0; j < log_level.names().length(); j++ ){
-			if( loaded_log_level(i) == log_level.names()(j)  ) 
-			{
-				log_level.values[j] = true;
-				break;
-			} 
-		}
-}
-
 }//namespace
Index: /library/bdm/base/datasources.cpp
===================================================================
--- /library/bdm/base/datasources.cpp (revision 927)
+++ /library/bdm/base/datasources.cpp (revision 942)
@@ -51,5 +51,4 @@
 	DS::from_setting ( set );
 
-	string filename;
 	UI::get ( filename, set, "filename", UI::compulsory );
 
Index: /library/bdm/itpp_ext.cpp
===================================================================
--- /library/bdm/itpp_ext.cpp (revision 869)
+++ /library/bdm/itpp_ext.cpp (revision 942)
@@ -412,5 +412,5 @@
 		long long tmp = (long long) (A * seed);
 		tmp = tmp % M;
-		seed = tmp;
+		seed = (double) tmp;
 		counter++;
 		return seed / M;
Index: /library/tests/testsuite/user_info_test.cpp
===================================================================
--- /library/tests/testsuite/user_info_test.cpp (revision 722)
+++ /library/tests/testsuite/user_info_test.cpp (revision 942)
@@ -95,4 +95,9 @@
 		Setting &manufacturer_setting = set.add ( "manufacturer", Setting::TypeString );
 		manufacturer_setting = manufacturer;
+	}
+
+	virtual string to_string() const
+	{
+		return "the method to_string() is not implemented";
 	}
 };
@@ -202,4 +207,8 @@
 	CHECK_EQUAL ( string ( "A car made in 1998 by audi, having 25000 kilometers on the clock.The names of passengers are as follows: Karlos Novak -1_CygWin_Matlab_Aimsun Karlosik Novacek " ), pepikovo->to_string() );
 
+	Transport pepikovo_static;
+	UI::get( pepikovo_static, in, "pepikovo", UI::compulsory );
+	CHECK_EQUAL ( string ( "the method to_string() is not implemented" ), pepikovo_static.to_string() );
+	
 	shared_ptr<Transport> jardovo ( UI::build<Transport> ( in, "jardovo", UI::compulsory ) );
 	CHECK_EQUAL ( string ( "A car made in 1992 by liaz, having 1555000 kilometers on the clock." ), jardovo->to_string() );
