Index: cpp/frams/genetics/fH/fH_conv.cpp
===================================================================
--- cpp/frams/genetics/fH/fH_conv.cpp	(revision 780)
+++ cpp/frams/genetics/fH/fH_conv.cpp	(revision 797)
@@ -1,2 +1,6 @@
+// This file is a part of Framsticks SDK.  http://www.framsticks.com/
+// Copyright (C) 1999-2018  Maciej Komosinski and Szymon Ulatowski.
+// See LICENSE.txt for details.
+
 #include "fH_conv.h"
 
Index: cpp/frams/genetics/fH/fH_conv.h
===================================================================
--- cpp/frams/genetics/fH/fH_conv.h	(revision 780)
+++ cpp/frams/genetics/fH/fH_conv.h	(revision 797)
@@ -1,2 +1,6 @@
+// This file is a part of Framsticks SDK.  http://www.framsticks.com/
+// Copyright (C) 1999-2018  Maciej Komosinski and Szymon Ulatowski.
+// See LICENSE.txt for details.
+
 #ifndef _FH_CONV_H_
 #define _FH_CONV_H_
Index: cpp/frams/genetics/fH/fH_general.cpp
===================================================================
--- cpp/frams/genetics/fH/fH_general.cpp	(revision 780)
+++ cpp/frams/genetics/fH/fH_general.cpp	(revision 797)
@@ -1,2 +1,6 @@
+// This file is a part of Framsticks SDK.  http://www.framsticks.com/
+// Copyright (C) 1999-2018  Maciej Komosinski and Szymon Ulatowski.
+// See LICENSE.txt for details.
+
 #include <string>
 #include <limits>
@@ -13,7 +17,7 @@
 // Methods for loading handles
 
-const char *fH_part_names[PART_PROPS_COUNT] = { "dn", "fr", "ing", "as" };
-
-const char *fH_joint_names[JOINT_PROPS_COUNT] = { "stif", "rotstif", "stam" };
+const char *fH_part_names[FH_PART_PROPS_COUNT] = { "dn", "fr", "ing", "as" };
+
+const char *fH_joint_names[FH_JOINT_PROPS_COUNT] = { "stif", "rotstif", "stam" };
 
 void fH_Handle::loadProperties(Param par)
@@ -106,5 +110,5 @@
 
 	Part p;
-	for (int i = 0; i < PART_PROPS_COUNT; i++)
+	for (int i = 0; i < FH_PART_PROPS_COUNT; i++)
 	{
 		stickmut.addProperty(&p.properties().getParamTab()[p.properties().findId(fH_part_names[i]) + p.properties().getGroupCount()], -1);
@@ -112,5 +116,5 @@
 
 	Joint j;
-	for (int i = 0; i < JOINT_PROPS_COUNT; i++)
+	for (int i = 0; i < FH_JOINT_PROPS_COUNT; i++)
 	{
 		stickmut.addProperty(&j.properties().getParamTab()[j.properties().findId(fH_joint_names[i]) + j.properties().getGroupCount()], -1);
@@ -119,8 +123,8 @@
 
 	Neuro n;
-	neuronmut.addProperty(&n.properties().getParamTab()[n.properties().findId(PE_NEURO_DET) + n.properties().getGroupCount()], -1);
+	neuronmut.addProperty(&n.properties().getParamTab()[n.properties().findId(FH_PE_NEURO_DET) + n.properties().getGroupCount()], -1);
 
 	Param tmp(f0_neuroconn_paramtab, NULL);
-	connectionmut.addProperty(&tmp.getParamTab()[tmp.findId(PE_CONN_WEIGHT) + tmp.getGroupCount()], -1);
+	connectionmut.addProperty(&tmp.getParamTab()[tmp.findId(FH_PE_CONN_WEIGHT) + tmp.getGroupCount()], -1);
 
 	stickparamtab = ParamObject::makeParamTab((ParamInterface *)&stickmut, 0, 0, stickmut.firstMutableIndex());
@@ -343,6 +347,6 @@
 {
 	Param par(tab, obj);
-	double partprops[PART_PROPS_COUNT];
-	for (int i = 0; i < PART_PROPS_COUNT; i++)
+	double partprops[FH_PART_PROPS_COUNT];
+	for (int i = 0; i < FH_PART_PROPS_COUNT; i++)
 	{
 		partprops[i] = par.getDouble(2 * getDimensions() + i);
@@ -357,5 +361,5 @@
 	{
 		par.select(child->obj);
-		for (int i = 0; i < PART_PROPS_COUNT; i++)
+		for (int i = 0; i < FH_PART_PROPS_COUNT; i++)
 		{
 			partprops[i] += par.getDouble(2 * getDimensions() + i);
@@ -364,5 +368,5 @@
 	}
 
-	for (int i = 0; i < PART_PROPS_COUNT; i++)
+	for (int i = 0; i < FH_PART_PROPS_COUNT; i++)
 	{
 		partprops[i] /= stickscount;
@@ -522,4 +526,5 @@
 			msg += det + "\" does not exist";
 			logMessage("fH_Builder", "developBrain", LOG_ERROR, msg.c_str());
+			delete currneu->neuron;
 			return -1;
 		}
@@ -601,5 +606,7 @@
 		if (!beginneu)
 		{
-			logMessage("fH_Builder", "developBrain", LOG_WARN, "There are no available neurons with outputs, connection could not be established");
+			// due to often appearance of connection genes in fB encoding, this
+			// log message is commented
+			// logMessage("fH_Builder", "developBrain", LOG_DEBUG, "There are no available neurons with outputs, connection could not be established");
 			continue;
 		}
@@ -628,5 +635,7 @@
 		if (!endneu)
 		{
-			logMessage("fH_Builder", "developBrain", LOG_WARN, "There are no available neurons with free inputs, connection could not be established");
+			// due to often appearance of connection genes in fB encoding, this
+			// log message is commented
+			// logMessage("fH_Builder", "developBrain", LOG_DEBUG, "There are no available neurons with free inputs, connection could not be established");
 			continue;
 		}
Index: cpp/frams/genetics/fH/fH_general.h
===================================================================
--- cpp/frams/genetics/fH/fH_general.h	(revision 780)
+++ cpp/frams/genetics/fH/fH_general.h	(revision 797)
@@ -1,2 +1,6 @@
+// This file is a part of Framsticks SDK.  http://www.framsticks.com/
+// Copyright (C) 1999-2018  Maciej Komosinski and Szymon Ulatowski.
+// See LICENSE.txt for details.
+
 #ifndef _FH_GENERAL_H_
 #define _FH_GENERAL_H_
@@ -14,8 +18,8 @@
 #define HANDLE_VECTOR_TYPE "f -1.0 1.0 0.0" ///<Vector values type definition
 #define STICKH_LENGTH_TYPE "f 0.001 1.999 1.0" ///<Length of stick handle. Minimum should not be equal to 0, because calculating direction of next part from current stick with length 0 would be impossible
-#define PART_PROPS_COUNT   4 ///<Count of part properties
-#define JOINT_PROPS_COUNT  3 ///<Count of joint properties
-#define PE_NEURO_DET       "d" ///<Id of details type definition in f0_neuro_paramtab
-#define PE_CONN_WEIGHT     "w" ///<Id of weight type definition in f0_neuroconn_paramtab
+#define FH_PART_PROPS_COUNT   4 ///<Count of part properties
+#define FH_JOINT_PROPS_COUNT  3 ///<Count of joint properties
+#define FH_PE_NEURO_DET       "d" ///<Id of details type definition in f0_neuro_paramtab
+#define FH_PE_CONN_WEIGHT     "w" ///<Id of weight type definition in f0_neuroconn_paramtab
 //@}
 
Index: cpp/frams/genetics/fH/fH_oper.cpp
===================================================================
--- cpp/frams/genetics/fH/fH_oper.cpp	(revision 780)
+++ cpp/frams/genetics/fH/fH_oper.cpp	(revision 797)
@@ -1,2 +1,6 @@
+// This file is a part of Framsticks SDK.  http://www.framsticks.com/
+// Copyright (C) 1999-2018  Maciej Komosinski and Szymon Ulatowski.
+// See LICENSE.txt for details.
+
 #include "fH_oper.h"
 
@@ -421,20 +425,9 @@
 }
 
-void Geno_fH::mutateNeuronHandleProperties(fH_NeuronHandle *handle, ParamEntry *tab, bool userandomclass)
+void Geno_fH::mutateNeuronProperties(SString &det)
 {
 	Neuro neu;
-	Param hpar(tab, handle->obj);
-	SString det = hpar.getStringById("d");
+	det = det == "" ? "N" : det;
 	neu.setDetails(det == "" ? "N" : det);
-	NeuroClass *nc = neu.getClass();
-
-	if (userandomclass)
-	{
-		nc = getRandomNeuroClass();
-		if (!nc) nc = Neuro::getClass("N");
-	}
-
-	det = nc->getName();
-	neu.setDetails(det);
 
 	SyntParam par = neu.classProperties();
@@ -455,32 +448,84 @@
 		if (props != "")
 		{
+			det = neu.getClass()->name;
 			det += ": ";
 			det += props;
-			hpar.setStringById("d", det);
-		}
-	}
-}
-
-uint32_t Geno_fH::style(const char *geno, int pos)
-{
-	char ch = geno[pos];
-	uint32_t style = GENSTYLE_CS(0, GENSTYLE_STRIKEOUT);
-	if (pos == 0 || geno[pos - 1] == '\n' || ch == ':') // single-character handle type and all colons
-	{
-		style = GENSTYLE_CS(GENCOLOR_TEXT, GENSTYLE_BOLD);
-	}
-	else if (isalpha(ch)) // properties name
-	{
-		style = GENSTYLE_RGBS(0, 200, 0, GENSTYLE_BOLD);
-	}
-	else if (isdigit(ch) || strchr(",.=", ch)) // properties values
-	{
-		style = GENSTYLE_CS(GENCOLOR_TEXT, GENSTYLE_NONE);
-	}
-	else if (ch == '\"')
-	{
-		style = GENSTYLE_RGBS(200, 0, 0, GENSTYLE_BOLD);
-	}
-
-	return style;
-}
+		}
+	}
+}
+
+void Geno_fH::mutateNeuronHandleProperties(fH_NeuronHandle *handle, ParamEntry *tab, bool userandomclass)
+{
+	Neuro neu;
+	Param hpar(tab, handle->obj);
+	SString det = hpar.getStringById("d");
+	neu.setDetails(det == "" ? "N" : det);
+	NeuroClass *nc = neu.getClass();
+
+	if (userandomclass)
+	{
+		nc = getRandomNeuroClass();
+		if (!nc) nc = Neuro::getClass("N");
+	}
+
+	det = nc->getName();
+
+	mutateNeuronProperties(det);
+
+	hpar.setStringById("d", det);
+}
+
+//uint32_t Geno_fH::style(const char *geno, int pos)
+//{
+//	char ch = geno[pos];
+//	uint32_t style = GENSTYLE_CS(0, GENSTYLE_STRIKEOUT);
+//	if (pos == 0 || geno[pos - 1] == '\n' || ch == ':') // single-character handle type and all colons
+//	{
+//		style = GENSTYLE_CS(GENCOLOR_TEXT, GENSTYLE_BOLD);
+//	}
+//	else if (isalpha(ch)) // properties name
+//	{
+//		style = GENSTYLE_RGBS(0, 200, 0, GENSTYLE_BOLD);
+//	}
+//	else if (isdigit(ch) || strchr(",.=", ch)) // properties values
+//	{
+//		style = GENSTYLE_CS(GENCOLOR_TEXT, GENSTYLE_NONE);
+//	}
+//	else if (ch == '\"')
+//	{
+//		style = GENSTYLE_RGBS(200, 0, 0, GENSTYLE_BOLD);
+//	}
+//
+//	return style;
+//}
+
+uint32_t Geno_fH::style(const char *g, int pos)
+{
+   char ch=g[pos];
+   uint32_t style=GENSTYLE_CS(0,GENSTYLE_NONE); //default, should be changed below
+
+   int pp=pos; //detect comment line
+   while (pp>1 && g[pp-1]!='\n') pp--;
+   if (g[pp]=='#') return GENSTYLE_RGBS(0,220,0,GENSTYLE_NONE); //comment line
+
+   if (pos==0 || g[pos-1]=='\n' || ch==':' || ch==',') style=GENSTYLE_CS(0,GENSTYLE_BOLD); else
+     if (ch=='\"') style=GENSTYLE_RGBS(150,0,0,GENSTYLE_BOLD); else
+     {
+      int cudz=0,neuclass=1; //ile cudz. do poczatku linii; czy w nazwie neuroklasy?
+      while (pos>0)
+      {
+         pos--;
+         if (g[pos]=='\"') cudz++;
+         if (cudz==0 && (g[pos]==':' || g[pos]==',')) neuclass=0;
+         if (g[pos]=='\n') break;
+      }
+      if (cudz%2)
+      {
+         if (neuclass) style=GENSTYLE_RGBS(150,0,150,GENSTYLE_BOLD); else //neuroclass
+           if (isalpha(ch)) style=GENSTYLE_RGBS(255,140,0,GENSTYLE_BOLD); else //property
+             style=GENSTYLE_RGBS(200,0,0,GENSTYLE_NONE);
+      } else
+        if (isalpha(ch)) style=GENSTYLE_RGBS(0,0,200,GENSTYLE_BOLD);
+     }
+   return style;
+}
Index: cpp/frams/genetics/fH/fH_oper.h
===================================================================
--- cpp/frams/genetics/fH/fH_oper.h	(revision 780)
+++ cpp/frams/genetics/fH/fH_oper.h	(revision 797)
@@ -1,2 +1,6 @@
+// This file is a part of Framsticks SDK.  http://www.framsticks.com/
+// Copyright (C) 1999-2018  Maciej Komosinski and Szymon Ulatowski.
+// See LICENSE.txt for details.
+
 #ifndef _FH_OPER_H_
 #define _FH_OPER_H_
@@ -87,4 +91,11 @@
 	double addoperations[FH_ADD_OPCOUNT]; ///<relative probabilities of selecting mutation addition subtypes
 
+	// TODO add to GenoOperators?
+	/**
+	 * Mutates properties of neuron and returns full neuron class description.
+	 * @param det current neuron class definition with its parameters
+	 */
+	static void mutateNeuronProperties(SString &det);
+
 	Geno_fH();
 
