Index: cpp/frams/genetics/f4/conv_f4.cpp
===================================================================
--- cpp/frams/genetics/f4/conv_f4.cpp	(revision 534)
+++ cpp/frams/genetics/f4/conv_f4.cpp	(revision 671)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2017  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -179,5 +179,5 @@
 			// coordinates are left to be computed by Model
 			sprintf(tmpLine, "p:fr=%g,ing=%g,as=%g",
-				/*1.0/C->P.mass,*/ C->P.friction, C->P.ingest, C->P.assim
+				/*1.0/C->P.mass,*/ C->P.friction, C->P.ingestion, C->P.assimilation
 				//C->firstend.x, C->firstend.y, C->firstend.z
 				);
@@ -196,5 +196,5 @@
 		sprintf(tmpLine, "p:fr=%g,ing=%g,as=%g",
 			//C->lastend.x, C->lastend.y, C->lastend.z
-			/*"vol=" 1.0/C->P.mass,*/ C->P.friction, C->P.ingest, C->P.assim
+			/*"vol=" 1.0/C->P.mass,*/ C->P.friction, C->P.ingestion, C->P.assimilation
 			);
 		partidx = singleStepBuild(tmpLine, &range);
@@ -212,9 +212,9 @@
 			// relative position -- always (len, 0, 0), along the stick
 			// this is optional!
-			C->P.len,
+			C->P.length,
 			// relative rotation
 			C->xrot, C->zrot,
 			//C->P.ruch,   // rotstif
-			C->P.odpor
+			C->P.stamina
 			);
 		partidx = singleStepBuild(tmpLine, &range);
@@ -241,7 +241,7 @@
 		{
 			if (1 == C->ctrl)
-				sprintf(tmpLine, "n:j=%d,d=\"@:p=%g\"", C->dadlink->joint_refno, C->P.ruch);
+				sprintf(tmpLine, "n:j=%d,d=\"@:p=%g\"", C->dadlink->joint_refno, C->P.muscle_power);
 			else
-				sprintf(tmpLine, "n:j=%d,d=\"|:p=%g,r=%g\"", C->dadlink->joint_refno, C->P.ruch, C->mz);
+				sprintf(tmpLine, "n:j=%d,d=\"|:p=%g,r=%g\"", C->dadlink->joint_refno, C->P.muscle_power, C->mz);
 			partidx = singleStepBuild(tmpLine, &range);
 			if (partidx < 0) return -32;
Index: cpp/frams/genetics/f4/f4_general.cpp
===================================================================
--- cpp/frams/genetics/f4/f4_general.cpp	(revision 534)
+++ cpp/frams/genetics/f4/f4_general.cpp	(revision 671)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2017  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -20,14 +20,14 @@
 f4_Props::f4_Props()
 {
-	len = 1.0;
-	curv = 0.0;
-	mass = 1.0;
+	length = 1.0;
+	curvedness = 0.0;
+	weight = 1.0;
 	friction = 0.4;
-	ruch = 0.25; // bio
-	assim = 0.25; // bio
-	odpor = 0.25; // bio
-	ingest = 0.25; // bio
+	muscle_power = 0.25; // biol
+	assimilation = 0.25; // biol
+	stamina = 0.25; // biol
+	ingestion = 0.25; // biol
 	twist = 0.0;
-	energ = 1.0;
+	energy = 1.0;
 	normalizeBiol4();
 }
@@ -35,15 +35,16 @@
 void f4_Props::normalizeBiol4()
 {
-	// must sum to 1
-	double sum = ruch + assim + odpor + ingest;
-	if (0 == sum)
-	{
-		ruch = assim = odpor = ingest = 0.25;
-	}
-	else {
-		ruch /= sum;
-		assim /= sum;
-		odpor /= sum;
-		ingest /= sum;
+	// make them sum to 1
+	double sum = muscle_power + assimilation + stamina + ingestion;
+	if (sum == 0)
+	{
+		muscle_power = assimilation = stamina = ingestion = 0.25;
+	}
+	else
+	{
+		muscle_power /= sum;
+		assimilation /= sum;
+		stamina /= sum;
+		ingestion /= sum;
 	}
 }
@@ -53,26 +54,26 @@
 	switch (modif)
 	{
-	case 'L': len += (2.5 - len) * 0.3;
-		len = min(len, Model::getMaxJoint().d.x); break;
-	case 'l': len += (0.3 - len) * 0.3;
-		len = max(len, Model::getMinJoint().d.x); break;
-	case 'C': curv += (2.0 - curv) * 0.25;  break;
-	case 'c': curv += (-2.0 - curv) * 0.25;  break;
+	case 'L': length += (2.5 - length) * 0.3;
+		length = min(length, Model::getMaxJoint().d.x); break;
+	case 'l': length += (0.3 - length) * 0.3;
+		length = max(length, Model::getMinJoint().d.x); break;
+	case 'C': curvedness += (2.0 - curvedness) * 0.25;  break;
+	case 'c': curvedness += (-2.0 - curvedness) * 0.25;  break;
 	case 'Q': twist += (1.58 - twist) * 0.3; break;
 	case 'q': twist += (-1.58 - twist) * 0.3; break;
-	case 'A': assim += (1 - assim) * 0.8; normalizeBiol4(); break;
-	case 'a': assim -= assim * 0.4;       normalizeBiol4(); break;
-	case 'I': ingest += (1 - ingest) * 0.8;   normalizeBiol4(); break;
-	case 'i': ingest -= ingest * 0.4;         normalizeBiol4(); break;
-	case 'S': odpor += (1 - odpor) * 0.8; normalizeBiol4(); break;
-	case 's': odpor -= odpor * 0.4;       normalizeBiol4(); break;
-	case 'M': ruch += (1 - ruch) * 0.8;   normalizeBiol4(); break;
-	case 'm': ruch -= ruch * 0.4;         normalizeBiol4(); break;
+	case 'A': assimilation += (1 - assimilation) * 0.8; normalizeBiol4(); break;
+	case 'a': assimilation -= assimilation * 0.4;       normalizeBiol4(); break;
+	case 'I': ingestion += (1 - ingestion) * 0.8;   normalizeBiol4(); break;
+	case 'i': ingestion -= ingestion * 0.4;         normalizeBiol4(); break;
+	case 'S': stamina += (1 - stamina) * 0.8; normalizeBiol4(); break;
+	case 's': stamina -= stamina * 0.4;       normalizeBiol4(); break;
+	case 'M': muscle_power += (1 - muscle_power) * 0.8;   normalizeBiol4(); break;
+	case 'm': muscle_power -= muscle_power * 0.4;         normalizeBiol4(); break;
 	case 'F': friction += (4 - friction) * 0.2; break;
 	case 'f': friction -= friction * 0.2;       break;
-	case 'W': mass += (2.0 - mass) * 0.3;   break;
-	case 'w': mass += (0.5 - mass) * 0.3;   break;
-	case 'E': energ += (10.0 - energ) * 0.1; break;
-	case 'e': energ -= energ * 0.1;          break;
+	case 'W': weight += (2.0 - weight) * 0.3;   break;
+	case 'w': weight += (0.5 - weight) * 0.3;   break;
+	case 'E': energy += (10.0 - energy) * 0.1; break;
+	case 'e': energy -= energy * 0.1;          break;
 	}
 }
@@ -80,6 +81,6 @@
 void f4_Props::adjust()
 {
-	len = 0.5*len + 0.5*stdProps.len;
-	curv = 0.66 * curv;
+	length = 0.5*length + 0.5*stdProps.length;
+	curvedness = 0.66 * curvedness;
 	twist = 0.66 * twist;
 }
@@ -88,8 +89,11 @@
 
 
-void rolling_dec(double * v) {
+void rolling_dec(double * v)
+{
 	*v -= 0.7853;  // 0.7853981  45 degrees
 }
-void rolling_inc(double * v) {
+
+void rolling_inc(double * v)
+{
 	*v += 0.7853;  // 0.7853981  45 degrees
 }
@@ -106,6 +110,6 @@
 		if (stopchar == s[i])  // bumped into stopchar
 			return i;
-		if (i < slen - 1)
-		{ // s[i] is not the last char
+		if (i < slen - 1) // s[i] is not the last char
+		{
 			if (s[i] == '(')
 			{
@@ -183,6 +187,5 @@
 
 
-f4_Cell::f4_Cell(f4_Cells * nO, int nname, f4_node * ngeno, f4_node * ngcur,
-	f4_Cell * ndad, int nangle, f4_Props newP)
+f4_Cell::f4_Cell(f4_Cells * nO, int nname, f4_node * ngeno, f4_node * ngcur, f4_Cell * ndad, int nangle, f4_Props newP)
 {
 	name = nname;
@@ -218,5 +221,6 @@
 	{
 		// make sure it is a stick (and not a stick f4_Cell!)
-		if (T_STICK4 == ndad->type) {
+		if (T_STICK4 == ndad->type)
+		{
 			//firstend = ndad->lastend;
 			//OM = ndad->OM;
@@ -279,5 +283,6 @@
 
 			// error: sticks cannot divide
-			if (T_STICK4 == type) {
+			if (T_STICK4 == type)
+			{
 				// cannot fix
 				org->setError(gcur->pos);
@@ -286,5 +291,6 @@
 
 			// undiff divides
-			if (T_UNDIFF4 == type) {
+			if (T_UNDIFF4 == type)
+			{
 				// commacount is set only when daughter turns into X
 				// daughter cell
@@ -292,6 +298,5 @@
 				f4_Props newP = P;
 				newP.adjust();
-				tmp = new f4_Cell(org, org->nc, genot, gcur->child2,
-					this, commacount, newP);
+				tmp = new f4_Cell(org, org->nc, genot, gcur->child2, this, commacount, newP);
 				tmp->repeat = repeat;
 				repeat.null();
@@ -310,5 +315,6 @@
 				// duplicate links
 				f4_CellLink * ll;
-				for (i = 0; i < nolink; i++) {
+				for (i = 0; i < nolink; i++)
+				{
 					ll = links[i];
 					tmp->addlink(ll->from, ll->w, ll->t);
@@ -334,5 +340,6 @@
 						gcur = repeat.first()->node->child;
 					}
-					else {
+					else
+					{
 						// continue
 						gcur = repeat.first()->node->child2;
@@ -341,9 +348,11 @@
 					break;
 				}
-				else {
+				else
+				{
 					repeat.pop();
 				}
 			}
-			else {
+			else
+			{
 				// error: still undiff
 				if (T_UNDIFF4 == type)
@@ -351,6 +360,5 @@
 					// fix it: insert an 'X'
 					f4_node * insertnode = new f4_node('X', NULL, gcur->pos);
-					if (org->setRepairInsert(gcur->pos, gcur, insertnode))
-						// not in repair mode, release
+					if (org->setRepairInsert(gcur->pos, gcur, insertnode)) // not in repair mode, release						
 						delete insertnode;
 					return 1;
@@ -383,10 +391,12 @@
 		case 'r':  case 'R':
 			// error: if neuron
-			if (T_NEURON4 == type) {
+			if (T_NEURON4 == type)
+			{
 				// fix: delete it
 				org->setRepairRemove(gcur->pos, gcur);
 				return 1;  // stop
 			}
-			switch (gcur->name) {
+			switch (gcur->name)
+			{
 			case 'r':   rolling_dec(&rolling); break;
 			case 'R':   rolling_inc(&rolling); break;
@@ -406,5 +416,6 @@
 		case 'e':  case 'E':
 			// error: if neuron
-			if (T_NEURON4 == type) {
+			if (T_NEURON4 == type)
+			{
 				// fix: delete it
 				org->setRepairRemove(gcur->pos, gcur);
@@ -418,5 +429,6 @@
 			// turn undiff. cell into a stick
 			// error: already differentiated
-			if (T_UNDIFF4 != type) {
+			if (T_UNDIFF4 != type)
+			{
 				// fix: delete this node
 				org->setRepairRemove(gcur->pos, gcur);
@@ -425,5 +437,6 @@
 			type = T_STICK4;
 			// fix dad commacount and own anglepos
-			if (NULL != dadlink) {
+			if (NULL != dadlink)
+			{
 				dadlink->commacount++;
 				anglepos = dadlink->commacount;
@@ -436,5 +449,6 @@
 			// turn undiff. cell into a neuron
 			// error: already differentiated
-			if (T_UNDIFF4 != type) {
+			if (T_UNDIFF4 != type)
+			{
 				// fix: delete this node
 				org->setRepairRemove(gcur->pos, gcur);
@@ -442,5 +456,6 @@
 			}
 			// error: if no previous
-			if (NULL == dadlink) {
+			if (NULL == dadlink)
+			{
 				// fix: delete it
 				org->setRepairRemove(gcur->pos, gcur);
@@ -461,5 +476,6 @@
 			if ('|' == gcur->name) j = 2; // bend
 			// error: not a neuron (undiff)
-			if (T_UNDIFF4 == type) {
+			if (T_UNDIFF4 == type)
+			{
 				// fix: delete it
 				org->setRepairRemove(gcur->pos, gcur);
@@ -467,5 +483,6 @@
 			}
 			// error: not a neuron (stick)
-			if (T_NEURON4 != type) {
+			if (T_NEURON4 != type)
+			{
 				// fix: delete it
 				org->setRepairRemove(gcur->pos, gcur);
@@ -473,5 +490,6 @@
 			}
 			// error: already has control
-			if (ctrl != 0) {
+			if (ctrl != 0)
+			{
 				// fix: delete it
 				org->setRepairRemove(gcur->pos, gcur);
@@ -486,5 +504,6 @@
 			// link to neuron
 			// error: not a neuron
-			if (T_NEURON4 != type) {
+			if (T_NEURON4 != type)
+			{
 				// fix: delete it
 				org->setRepairRemove(gcur->pos, gcur);
@@ -495,5 +514,6 @@
 			relfrom = gcur->l1;
 			w = gcur->f1;
-			if (t > 0) {
+			if (t > 0)
+			{
 				// * or G
 				tneu = NULL;
@@ -504,5 +524,6 @@
 				// find own index
 				j = 0; k = 0;
-				for (i = 0; i < org->nc; i++) {
+				for (i = 0; i < org->nc; i++)
+				{
 					if (org->C[i]->type == T_NEURON4) k++;
 					if (org->C[i] == this) { j = k - 1; break; }
@@ -514,5 +535,6 @@
 				// find that neuron
 				k = 0;
-				for (i = 0; i < org->nc; i++) {
+				for (i = 0; i < org->nc; i++)
+				{
 					if (org->C[i]->type == T_NEURON4) k++;
 					if (j == (k - 1)) break;
@@ -523,5 +545,6 @@
 			// add link
 			// error: could not add link (too many?)
-			if (addlink(tneu, w, t)) {
+			if (addlink(tneu, w, t))
+			{
 				// cannot fix
 				org->setError(gcur->pos);
@@ -535,8 +558,9 @@
 			active = 0;
 			j = 0;
-			for (i = 0; i<org->nc; i++) {
+			for (i = 0; i < org->nc; i++)
+			{
 				if (org->C[i]->active) j++;
 			}
-			if (j>0)
+			if (j > 0)
 				return 0;  // there is other active, halt, try again
 			// no more actives, cannot add link, ignore, but treat not as an error
@@ -547,5 +571,6 @@
 			// neuron parameter
 			// error: not a neuron
-			if (T_NEURON4 != type) {
+			if (T_NEURON4 != type)
+			{
 				// fix: delete it
 				org->setRepairRemove(gcur->pos, gcur);
@@ -553,5 +578,6 @@
 			}
 			j = (int)gcur->l1;
-			switch ((char)gcur->i1) {
+			switch ((char)gcur->i1)
+			{
 			case '!':
 				if (j) force += (1.0 - force) * 0.2;
@@ -604,5 +630,5 @@
 {
 	//f4_OrientMat rot;
-	int     i;
+	int i;
 
 	if (recProcessedFlag)
@@ -635,5 +661,6 @@
 			mz = 1;
 		}
-		else {
+		else
+		{
 			//firstend = dadlink->lastend;
 			f4_Props Pdad = dadlink->P;
@@ -650,10 +677,9 @@
 			{
 				// rotation due to curvedness
-				zrot = Padj.curv;
-			}
-			else {
-				zrot = Padj.curv +
-					// SDK uses 3.141 instead of PI!
-					(anglepos * 1.0 / (dadlink->commacount + 1) - 0.5) * 3.141 * 2.0;
+				zrot = Padj.curvedness;
+			}
+			else
+			{
+				zrot = Padj.curvedness + (anglepos * 1.0 / (dadlink->commacount + 1) - 0.5) * M_PI * 2.0;
 			}
 
@@ -722,6 +748,5 @@
 
 	// create ancestor cell
-	C[0] = new f4_Cell(this, 0, f4rootnode->child, f4rootnode->child,
-		NULL, 0, stdProps);
+	C[0] = new f4_Cell(this, 0, f4rootnode->child, f4rootnode->child, NULL, 0, stdProps);
 	nc = 1;
 }
@@ -747,7 +772,9 @@
 	oldnc = nc;
 	ret = 0;
-	for (i = 0; i<oldnc; i++) {
+	for (i = 0; i < oldnc; i++)
+	{
 		ret2 = C[i]->onestep();
-		if (ret2>0) {
+		if (ret2 > 0)
+		{
 			// error
 			C[i]->active = 0;  // stop
@@ -776,17 +803,24 @@
 	// fix neuron attachements
 	for (i = 0; i < nc; i++)
-		if (C[i]->type == T_NEURON4) {
-			while (T_NEURON4 == C[i]->dadlink->type) {
+	{
+		if (C[i]->type == T_NEURON4)
+		{
+			while (T_NEURON4 == C[i]->dadlink->type)
+			{
 				C[i]->dadlink = C[i]->dadlink->dadlink;
 			}
 		}
+	}
 
 	// there should be no undiff. cells
 	// make undifferentiated cells sticks
 	for (i = 0; i < nc; i++)
-		if (C[i]->type == T_UNDIFF4) {
+	{
+		if (C[i]->type == T_UNDIFF4)
+		{
 			C[i]->type = T_STICK4;
 			//seterror();
 		}
+	}
 
 	// recursive adjust
@@ -806,5 +840,6 @@
 void f4_Cells::addCell(f4_Cell * newcell)
 {
-	if (nc >= MAX4CELLS - 1) {
+	if (nc >= MAX4CELLS - 1)
+	{
 		delete newcell;
 		return;
@@ -823,10 +858,12 @@
 void f4_Cells::setRepairRemove(int nerrpos, f4_node * rem)
 {
-	if (!repair) {
+	if (!repair)
+	{
 		// not in repair mode, treat as repairable error
 		error = GENOPER_REPAIR;
 		errorpos = nerrpos;
 	}
-	else {
+	else
+	{
 		error = GENOPER_REPAIR;
 		errorpos = nerrpos;
@@ -837,5 +874,6 @@
 int f4_Cells::setRepairInsert(int nerrpos, f4_node * parent, f4_node * insert)
 {
-	if (!repair) {
+	if (!repair)
+	{
 		// not in repair mode, treat as repairable error
 		error = GENOPER_REPAIR;
@@ -843,5 +881,6 @@
 		return -1;
 	}
-	else {
+	else
+	{
 		error = GENOPER_REPAIR;
 		errorpos = nerrpos;
@@ -863,8 +902,10 @@
 	if (NULL == g2)
 		return;
-	if (g2 == repair_remove) {
+	if (g2 == repair_remove)
+	{
 		f4_node * oldgeno;
 		geno->removeChild(g2);
-		if (g2->child) {
+		if (g2->child)
+		{
 			// add g2->child as child to geno
 			if (1 == whichchild) geno->child = g2->child;
@@ -880,5 +921,6 @@
 		return;
 	}
-	if (g2 == repair_parent) {
+	if (g2 == repair_parent)
+	{
 		geno->removeChild(g2);
 		geno->addChild(repair_insert);
@@ -921,29 +963,31 @@
 	// adjust length, curvedness, etc.
 	tmpcel->P.adjust();
-	while (tmpcel->P.len > thisti->P.len)
+	while (tmpcel->P.length > thisti->P.length)
 	{
 		tmpcel->P.executeModifier('l');
 		out += "l";
 	}
-	while (tmpcel->P.len < thisti->P.len)
+	while (tmpcel->P.length < thisti->P.length)
 	{
 		tmpcel->P.executeModifier('L');
 		out += "L";
 	}
-	while (tmpcel->P.curv > thisti->P.curv)
+	while (tmpcel->P.curvedness > thisti->P.curvedness)
 	{
 		tmpcel->P.executeModifier('c');
 		out += "c";
 	}
-	while (tmpcel->P.curv < thisti->P.curv)
+	while (tmpcel->P.curvedness < thisti->P.curvedness)
 	{
 		tmpcel->P.executeModifier('C');
 		out += "C";
 	}
-	while (thisti->rolling > 0.0f) {
+	while (thisti->rolling > 0.0f)
+	{
 		rolling_dec(&(thisti->rolling));
 		out += "R";
 	}
-	while (thisti->rolling < 0.0f) {
+	while (thisti->rolling < 0.0f)
+	{
 		rolling_inc(&(thisti->rolling));
 		out += "r";
@@ -955,6 +999,9 @@
 	// neurons attached to it
 	for (i = 0; i < nc; i++)
-		if (C[i]->type == T_NEURON4) {
-			if (C[i]->dadlink == thisti) {
+	{
+		if (C[i]->type == T_NEURON4)
+		{
+			if (C[i]->dadlink == thisti)
+			{
 				thneu = C[i];
 				out += "[";
@@ -974,10 +1021,11 @@
 						if (4 == thneu->links[j]->t) out += "S";
 					}
-					else {
+					else
+					{
 						sprintf(buf, "%d", thneu->links[j]->from->name - thneu->name);
 						out += buf;
 					}
 					out += ":";
-					// weight
+					// connection weight
 					sprintf(buf, "%g", thneu->links[j]->w);
 					out += buf;
@@ -986,4 +1034,5 @@
 			}
 		}
+	}
 
 	// sticks connected to it
@@ -993,7 +1042,11 @@
 	ccount = 1;
 	for (i = 0; i < nc; i++)
+	{
 		if (C[i]->type == T_STICK4)
-			if (C[i]->dadlink == thisti) {
-				while (ccount < (C[i])->anglepos) {
+		{
+			if (C[i]->dadlink == thisti)
+			{
+				while (ccount < (C[i])->anglepos)
+				{
 					ccount++;
 					out += ",";
@@ -1001,5 +1054,9 @@
 				toF1GenoRec(i, out);
 			}
-	while (ccount < thisti->commacount) {
+		}
+	}
+
+	while (ccount < thisti->commacount)
+	{
 		ccount++;
 		out += ",";
@@ -1012,5 +1069,5 @@
 
 
-// to organize a f4 genotype in a tree structure
+// to organize an f4 genotype in a tree structure
 
 f4_node::f4_node()
@@ -1043,9 +1100,11 @@
 int f4_node::addChild(f4_node * nchi)
 {
-	if (NULL == child) {
+	if (NULL == child)
+	{
 		child = nchi;
 		return 0;
 	}
-	if (NULL == child2) {
+	if (NULL == child2)
+	{
 		child2 = nchi;
 		return 0;
@@ -1056,9 +1115,11 @@
 int f4_node::removeChild(f4_node * nchi)
 {
-	if (nchi == child2) {
+	if (nchi == child2)
+	{
 		child2 = NULL;
 		return 0;
 	}
-	if (nchi == child) {
+	if (nchi == child)
+	{
 		child = NULL;
 		return 0;
@@ -1069,9 +1130,11 @@
 int f4_node::childCount()
 {
-	if (NULL != child) {
+	if (NULL != child)
+	{
 		if (NULL != child2) return 2;
 		else return 1;
 	}
-	else {
+	else
+	{
 		if (NULL != child2) return 1;
 		else return 0;
@@ -1092,10 +1155,12 @@
 	if (0 == n) return this;
 	n--;
-	if (NULL != child) {
+	if (NULL != child)
+	{
 		n1 = child->count();
 		if (n < n1) return child->ordNode(n);
 		n -= n1;
 	}
-	if (NULL != child2) {
+	if (NULL != child2)
+	{
 		n1 = child2->count();
 		if (n < n1) return child2->ordNode(n);
@@ -1119,5 +1184,6 @@
 	f4_node * nod = NULL;
 	maxlim = count();
-	for (i = 0; i < maxlim; i++) {
+	for (i = 0; i < maxlim; i++)
+	{
 		nod = randomNode();
 		n = nod->count();
@@ -1135,5 +1201,6 @@
 	{
 		out += "#";
-		if (i1 != 1) {
+		if (i1 != 1)
+		{
 			sprintf(buf2, "%d", i1);
 			out += buf2;
@@ -1142,7 +1209,9 @@
 	else {
 		// special case: neuron link
-		if ('[' == name) {
+		if ('[' == name)
+		{
 			out += "[";
-			if (i1 > 0) {
+			if (i1 > 0)
+			{
 				// sensor input
 				if (1 == i1) out += "*";
@@ -1151,5 +1220,6 @@
 				if (4 == i1) out += "S";
 			}
-			else {
+			else
+			{
 				sprintf(buf2, "%ld", l1);
 				out += buf2;
@@ -1158,9 +1228,11 @@
 			out += buf2;
 		}
-		else if (':' == name) {
+		else if (':' == name)
+		{
 			sprintf(buf2, ":%c%c:", l1 ? '+' : '-', (char)i1);
 			out += buf2;
 		}
-		else {
+		else
+		{
 			buf2[0] = name;
 			buf2[1] = 0;
@@ -1194,5 +1266,6 @@
 	// copy back to string
 	// if new is longer, reallocate buf
-	if (len + 1 > strlen(buf)) {
+	if (len + 1 > strlen(buf))
+	{
 		buf = (char*)realloc(buf, len + 1);
 	}
@@ -1207,9 +1280,11 @@
 	copy->child = NULL;
 	copy->child2 = NULL;
-	if (NULL != child) {
+	if (NULL != child)
+	{
 		copy->child = child->duplicate();
 		copy->child->parent = copy;
 	}
-	if (NULL != child2) {
+	if (NULL != child2)
+	{
 		copy->child2 = child2->duplicate();
 		copy->child2->parent = copy;
@@ -1241,7 +1316,9 @@
 	par = parent;
 	if (gpos >= strlen(genot)) return 1;
-	while (gpos < strlen(genot)) {
+	while (gpos < strlen(genot))
+	{
 		//DB( printf(" processing '%c' %d %s\n", genot[gpos], gpos, genot); )
-		switch (genot[gpos]) {
+		switch (genot[gpos])
+		{
 		case '<':
 			// cell division!
@@ -1255,9 +1332,11 @@
 			res = f4_processrec(genot, gpos + 1, par);
 			if (res) return res;
-			if (gpos + j + 2 < strlen(genot)) {
+			if (gpos + j + 2 < strlen(genot))
+			{
 				res = f4_processrec(genot, gpos + j + 2, par);
 				if (res) return res;
 			}
-			else {  // ran out
+			else // ran out
+			{
 				node1 = new f4_node('>', par, strlen(genot) - 1);
 				par = node1;
@@ -1287,9 +1366,11 @@
 			res = f4_processrec(genot, gpos, node1);
 			if (res) return res;
-			if (oldpos + j + 2 < strlen(genot)) {
+			if (oldpos + j + 2 < strlen(genot))
+			{
 				res = f4_processrec(genot, oldpos + j + 2, node1);
 				if (res) return res;
 			}
-			else {  // ran out
+			else // ran out
+			{
 				node1 = new f4_node('>', par, strlen(genot) - 1);
 			}
@@ -1344,5 +1425,6 @@
 			else if ('-' == tc1) j = 0;
 			else return gpos + 1 + 1;
-			switch (tc2) {
+			switch (tc2)
+			{
 			case '!':  case '=':  case '/':  break;
 			default:
@@ -1377,8 +1459,12 @@
 	// should end with a '>'
 	if (par)
-		if ('>' != par->name) {
+	{
+		if ('>' != par->name)
+		{
 			node1 = new f4_node('>', par, strlen(genot) - 1);
 			par = node1;
 		}
+	}
+
 	return 0;  // OK
 }
@@ -1394,11 +1480,12 @@
 	//DB( printf("test f4  "); )
 	DB(
-		if (root->child) {
-			char * buf = (char*)malloc(300);
-			DB(printf("(%d) ", root->child->count());)
-				buf[0] = 0;
-			root->child->sprintAdj(buf);
-			DB(printf("%s\n", buf);)
-				free(buf);
+		if (root->child)
+		{
+		char * buf = (char*)malloc(300);
+		DB(printf("(%d) ", root->child->count());)
+			buf[0] = 0;
+		root->child->sprintAdj(buf);
+		DB(printf("%s\n", buf);)
+			free(buf);
 		}
 	)
Index: cpp/frams/genetics/f4/f4_general.h
===================================================================
--- cpp/frams/genetics/f4/f4_general.h	(revision 534)
+++ cpp/frams/genetics/f4/f4_general.h	(revision 671)
@@ -28,14 +28,14 @@
 	void adjust();
 
-	double len;      // length (dlug)
-	double curv;     // curvedness (skr)
-	double mass;
+	double length;
+	double curvedness;
+	double weight;
 	double friction;
-	double ruch;
-	double assim;
-	double odpor;
-	double ingest;  // ingestion (wchl)
+	double muscle_power;
+	double assimilation;
+	double stamina;
+	double ingestion;
 	double twist;
-	double energ;
+	double energy;
 };
 
Index: cpp/frams/genetics/f4/oper_f4.cpp
===================================================================
--- cpp/frams/genetics/f4/oper_f4.cpp	(revision 534)
+++ cpp/frams/genetics/f4/oper_f4.cpp	(revision 671)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2017  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -231,5 +231,6 @@
 		// must pick a node with parent, and at least one child
 		// already picked a node, but repeat may be needed
-		for (int i = 0; i < 10; i++) {
+		for (int i = 0; i < 10; i++)
+		{
 			if ((NULL != n1->parent) && (g != n1->parent))
 				if (NULL != n1->child)
@@ -247,10 +248,12 @@
 				n2 = n1->parent;
 				n2->removeChild(n1);
-				if (NULL != n1->child) {
+				if (NULL != n1->child)
+				{
 					n1->child->parent = n2;
 					n2->addChild(n1->child);
 					n1->child = NULL;
 				}
-				if (NULL != n1->child2) {
+				if (NULL != n1->child2)
+				{
 					n1->child2->parent = n2;
 					n2->addChild(n1->child2);
@@ -309,5 +312,6 @@
 			if (i >= 20) return GENOPER_OPFAIL;
 		}
-		switch (n1->name) {
+		switch (n1->name)
+		{
 		case '<':
 			// swap children
@@ -348,5 +352,6 @@
 	nn->i1 = i;
 	nn->l1 = 0;
-	if (0 == i) {
+	if (0 == i)
+	{
 		// relative input link
 		nn->l1 = (int)(4.0f * (rnd01 - 0.5f));
@@ -407,6 +412,6 @@
 	if (prob1 < 0.5f) count++;
 	else count--;
-	if (count<1) count = 1;
-	if (count>REP_MAXCOUNT) count = REP_MAXCOUNT;
+	if (count < 1) count = 1;
+	if (count > REP_MAXCOUNT) count = REP_MAXCOUNT;
 	nn->i1 = count;
 }
@@ -464,5 +469,6 @@
 	if (f4_processrec(g, 0, root) || root->childCount() != 1)
 	{
-		delete root; return GENOPER_OPFAIL;
+		delete root;
+		return GENOPER_OPFAIL;
 	} // could not convert or bad: fail
 	// mutate one node, set chg as this percent
@@ -470,5 +476,6 @@
 	if (MutateOneValid(root, method) != GENOPER_OK)
 	{
-		delete root; return GENOPER_OPFAIL;
+		delete root;
+		return GENOPER_OPFAIL;
 	}
 	// OK, convert back to string
Index: cpp/frams/genetics/f4/oper_f4.h
===================================================================
--- cpp/frams/genetics/f4/oper_f4.h	(revision 534)
+++ cpp/frams/genetics/f4/oper_f4.h	(revision 671)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2017  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
