Index: trunk/FACT++/src/StateMachineImp.cc
===================================================================
--- trunk/FACT++/src/StateMachineImp.cc	(revision 10293)
+++ trunk/FACT++/src/StateMachineImp.cc	(revision 10294)
@@ -472,5 +472,5 @@
 //!    received commands is properly extracted. No check is done.
 //
-EventImp *StateMachineImp::AddTransition(int targetstate, const char *name, const char *states, const char *fmt)
+EventImp &StateMachineImp::AddTransition(int targetstate, const char *name, const char *states, const char *fmt)
 {
     EventImp *evt = CreateEvent(targetstate, name, fmt);
@@ -483,5 +483,5 @@
     fListOfEvents.push_back(evt);
 
-    return evt;
+    return *evt;
 }
 
@@ -507,5 +507,5 @@
 //!    by this command.
 //
-EventImp *StateMachineImp::AddTransition(int targetstate, const char *name, int s1, int s2, int s3, int s4, int s5)
+EventImp &StateMachineImp::AddTransition(int targetstate, const char *name, int s1, int s2, int s3, int s4, int s5)
 {
     return AddTransition(targetstate, name, Form("%d %d %d %d %d", s1, s2, s3, s4, s5).c_str(), "");
@@ -539,5 +539,5 @@
 //!    by this command.
 //
-EventImp *StateMachineImp::AddTransition(int targetstate, const char *name, const char *fmt, int s1, int s2, int s3, int s4, int s5)
+EventImp &StateMachineImp::AddTransition(int targetstate, const char *name, const char *fmt, int s1, int s2, int s3, int s4, int s5)
 {
     return AddTransition(targetstate, name, Form("%d %d %d %d %d", s1, s2, s3, s4, s5).c_str(), fmt);
@@ -566,5 +566,5 @@
 //!    received commands is properly extracted. No check is done.
 //!
-EventImp *StateMachineImp::AddConfiguration(const char *name, const char *states, const char *fmt)
+EventImp &StateMachineImp::AddConfiguration(const char *name, const char *states, const char *fmt)
 {
     return AddTransition(-1, name, states, fmt);
@@ -587,5 +587,5 @@
 //!    by this command.
 //
-EventImp *StateMachineImp::AddConfiguration(const char *name, int s1, int s2, int s3, int s4, int s5)
+EventImp &StateMachineImp::AddConfiguration(const char *name, int s1, int s2, int s3, int s4, int s5)
 {
     return AddTransition(-1, name, s1, s2, s3, s4, s5);
@@ -614,5 +614,5 @@
 //!    by this command.
 //
-EventImp *StateMachineImp::AddConfiguration(const char *name, const char *fmt, int s1, int s2, int s3, int s4, int s5)
+EventImp &StateMachineImp::AddConfiguration(const char *name, const char *fmt, int s1, int s2, int s3, int s4, int s5)
 {
     return AddTransition(-1, name, fmt, s1, s2, s3, s4, s5);
@@ -634,8 +634,8 @@
 //! @todo  FIX THE DOCU
 //
-void StateMachineImp::AddStateName(const int state, const std::string &name)
-{
-    if (fStateNames[state].empty())
-        fStateNames[state] = name;
+void StateMachineImp::AddStateName(const int state, const std::string &name, const std::string &doc)
+{
+    if (fStateNames[state].first.empty())
+        fStateNames[state] = make_pair(name, doc);
 }
 
@@ -652,6 +652,11 @@
 const string StateMachineImp::GetStateName(int state) /*const*/
 {
-    const string &str = fStateNames[state];
+    const string &str = fStateNames[state].first;
     return str.empty() ? Form("%d", state) : str;
+}
+
+const string StateMachineImp::GetStateDoc(int state) /*const*/
+{
+    return fStateNames[state].second;
 }
 
@@ -673,5 +678,5 @@
 const string StateMachineImp::GetStateDescription(int state) /*const*/
 {
-    const string &str = fStateNames[state];
+    const string &str = GetStateName(state);
     return str.empty() ? Form("%d", state) : (str+Form("[%d]", state));
 }
Index: trunk/FACT++/src/StateMachineImp.h
===================================================================
--- trunk/FACT++/src/StateMachineImp.h	(revision 10293)
+++ trunk/FACT++/src/StateMachineImp.h	(revision 10294)
@@ -32,5 +32,5 @@
 
     /// Human readable names associated with the states
-    std::map<const int, std::string> fStateNames;
+    std::map<const int, std::pair<std::string, std::string>> fStateNames;
 
     std::vector<EventImp*> fListOfEvents; /// List of available commands as setup by user
@@ -70,13 +70,13 @@
     virtual std::string SetCurrentState(int state, const char *txt="", const std::string &cmd="");
 
-    EventImp *AddTransition(int targetstate, const char *name, const char *states, const char *fmt);
-    EventImp *AddTransition(int targetstate, const char *name, int s1=-1, int s2=-1, int s3=-1, int s4=-1, int s5=-1);
-    EventImp *AddTransition(int targetstate, const char *name, const char *fmt, int s1=-1, int s2=-1, int s3=-1, int s4=-1, int s5=-1);
-
-    EventImp *AddConfiguration(const char *name, const char *states, const char *fmt);
-    EventImp *AddConfiguration(const char *name, int s1=-1, int s2=-1, int s3=-1, int s4=-1, int s5=-1);
-    EventImp *AddConfiguration(const char *name, const char *fmt, int s1=-1, int s2=-1, int s3=-1, int s4=-1, int s5=-1);
-
-    void AddStateName(const int state, const std::string &name);
+    EventImp &AddTransition(int targetstate, const char *name, const char *states, const char *fmt);
+    EventImp &AddTransition(int targetstate, const char *name, int s1=-1, int s2=-1, int s3=-1, int s4=-1, int s5=-1);
+    EventImp &AddTransition(int targetstate, const char *name, const char *fmt, int s1=-1, int s2=-1, int s3=-1, int s4=-1, int s5=-1);
+
+    EventImp &AddConfiguration(const char *name, const char *states, const char *fmt);
+    EventImp &AddConfiguration(const char *name, int s1=-1, int s2=-1, int s3=-1, int s4=-1, int s5=-1);
+    EventImp &AddConfiguration(const char *name, const char *fmt, int s1=-1, int s2=-1, int s3=-1, int s4=-1, int s5=-1);
+
+    void AddStateName(const int state, const std::string &name, const std::string &doc="");
 
 public:
@@ -123,4 +123,7 @@
     const std::string GetStateName(int state) /*const*/;
     const std::string GetStateName() { return GetStateName(fCurrentState); }
+
+    const std::string GetStateDesc(int state) /*const*/;
+    const std::string GetStateDesc() { return GetStateDesc(fCurrentState); }
 
     const std::string GetStateDescription(int state) /*const*/;
