Index: cpp/frams/_demos/f0_variants_test.cpp
===================================================================
--- cpp/frams/_demos/f0_variants_test.cpp	(revision 955)
+++ cpp/frams/_demos/f0_variants_test.cpp	(revision 972)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2016  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -12,110 +12,110 @@
 #include <common/loggers/loggertostdout.h>
 
-void save_as_f0(SString &gen,Model &m,bool omit_default_values)
+void save_as_f0(SString &gen, Model &m, bool omit_default_values)
 {
-// copied from Model::makeGeno() (with small changes)
+	// copied from Model::makeGeno() (with small changes)
 
-static Param modelparam(f0_model_paramtab);
-static Param partparam(f0_part_paramtab);
-static Param jointparam(f0_joint_paramtab);
-static Param neuroparam(f0_neuro_paramtab);
-static Param connparam(f0_neuroconn_paramtab);
+	static Param modelparam(f0_model_paramtab);
+	static Param partparam(f0_part_paramtab);
+	static Param jointparam(f0_joint_paramtab);
+	static Param neuroparam(f0_neuro_paramtab);
+	static Param connparam(f0_neuroconn_paramtab);
 
-static Part defaultpart;
-static Joint defaultjoint;
-static Neuro defaultneuro;
-static Model defaultmodel;
-static NeuroConn defaultconn;
+	static Part defaultpart;
+	static Joint defaultjoint;
+	static Neuro defaultneuro;
+	static Model defaultmodel;
+	static NeuroConn defaultconn;
 
-modelparam.select(&m);
-gen+="m:";
-modelparam.saveSingleLine(gen,omit_default_values ? &defaultmodel : NULL);
+	modelparam.select(&m);
+	gen += "m:";
+	modelparam.saveSingleLine(gen, omit_default_values ? &defaultmodel : NULL);
 
-Part *p;
-Joint *j;
-Neuro *n;
+	Part *p;
+	Joint *j;
+	Neuro *n;
 
-for (int i=0;p=(Part*)m.getPart(i);i++)
+	for (int i = 0; p = (Part*)m.getPart(i); i++)
 	{
-	partparam.select(p);
-	gen+="p:";
-	partparam.saveSingleLine(gen,omit_default_values ? &defaultpart : NULL);
+		partparam.select(p);
+		gen += "p:";
+		partparam.saveSingleLine(gen, omit_default_values ? &defaultpart : NULL);
 	}
-for (int i=0;j=(Joint*)m.getJoint(i);i++)
+	for (int i = 0; j = (Joint*)m.getJoint(i); i++)
 	{
-	jointparam.select(j);
-	jointparam.setParamTab(j->usedelta?f0_joint_paramtab:f0_nodeltajoint_paramtab);
-	gen+="j:";
-	jointparam.saveSingleLine(gen,omit_default_values ? &defaultjoint : NULL);
+		jointparam.select(j);
+		jointparam.setParamTab(j->usedelta ? f0_joint_paramtab : f0_nodeltajoint_paramtab);
+		gen += "j:";
+		jointparam.saveSingleLine(gen, omit_default_values ? &defaultjoint : NULL);
 	}
-for (int i=0;n=(Neuro*)m.getNeuro(i);i++)
+	for (int i = 0; n = (Neuro*)m.getNeuro(i); i++)
 	{
-	neuroparam.select(n);
-	gen+="n:";
-	neuroparam.saveSingleLine(gen,omit_default_values ? &defaultneuro : NULL);
+		neuroparam.select(n);
+		gen += "n:";
+		neuroparam.saveSingleLine(gen, omit_default_values ? &defaultneuro : NULL);
 	}
-for (int a=0;n=(Neuro*)m.getNeuro(a);a++)
+	for (int a = 0; n = (Neuro*)m.getNeuro(a); a++)
 	{ // inputs
-	for (int b=0;b<n->getInputCount();b++)
+		for (int b = 0; b < n->getInputCount(); b++)
 		{
-		double w;
-		NeuroConn nc;
-		Neuro* n2=n->getInput(b,w);
-		nc.n1_refno=n->refno; nc.n2_refno=n2->refno;
-		nc.weight=w;
-		nc.info=n->getInputInfo(b);
-		connparam.select(&nc);
-		gen+="c:";
-		connparam.saveSingleLine(gen,omit_default_values ? &defaultconn : NULL);
+			double w;
+			NeuroConn nc;
+			Neuro* n2 = n->getInput(b, w);
+			nc.n1_refno = n->refno; nc.n2_refno = n2->refno;
+			nc.weight = w;
+			nc.info = n->getInputInfo(b);
+			connparam.select(&nc);
+			gen += "c:";
+			connparam.saveSingleLine(gen, omit_default_values ? &defaultconn : NULL);
 		}
 	}
 }
 
-int main(int argc,char*argv[])
+int main(int argc, char*argv[])
 {
-LoggerToStdout messages_to_stdout(LoggerBase::Enable);
+	LoggerToStdout messages_to_stdout(LoggerBase::Enable);
 
-//without converters the application would only handle "format 0" genotypes
-DefaultGenoConvManager gcm;
-gcm.addDefaultConverters();
-Geno::useConverters(&gcm);
+	//without converters the application would only handle "format 0" genotypes
+	DefaultGenoConvManager gcm;
+	gcm.addDefaultConverters();
+	Geno::useConverters(&gcm);
 
-Geno::Validators validators;
-Geno::useValidators(&validators);
-ModelGenoValidator model_validator;
-validators+=&model_validator; //This simple validator handles all cases where a converter for a particular format is available but there is no genetic operator. Converters may be less strict in detecting invalid genotypes but it is better than nothing
+	Geno::Validators validators;
+	Geno::useValidators(&validators);
+	ModelGenoValidator model_validator;
+	validators += &model_validator; //This simple validator handles all cases where a converter for a particular format is available but there is no genetic operator. Converters may be less strict in detecting invalid genotypes but it is better than nothing
 
-SString gen(argc>1?argv[1]:"X[|G:1.23]");
-if (!strcmp(gen.c_str(),"-"))
+	SString gen(argc > 1 ? argv[1] : "X[|G:1.23]");
+	if (!strcmp(gen.c_str(), "-"))
 	{
-	gen=0;
-	StdioFILEDontClose in(stdin);
-	loadSString(&in,gen);
+		gen = 0;
+		StdioFILEDontClose in(stdin);
+		loadSString(&in, gen);
 	}
-Geno g(gen);
-printf("\nSource genotype: '%s'\n",g.getGenes().c_str());
-printf("                  ( format %s %s)\n",
-       g.getFormat().c_str(), g.getComment().c_str());
+	Geno g(gen);
+	printf("\nSource genotype: '%s'\n", g.getGenes().c_str());
+	printf("                  ( format %s %s)\n",
+		g.getFormat().c_str(), g.getComment().c_str());
 
-Model m(g);//.getConverted('0'));
+	Model m(g, Model::SHAPE_UNKNOWN);//.getConverted('0'));
 
-if (!m.isValid())
+	if (!m.isValid())
 	{
-	printf("Cannot build Model from this genotype!\n");
-	return 2;	
+		printf("Cannot build Model from this genotype!\n");
+		return 2;
 	}
 
-printf("\nthis example shows how to save a f0 genotype using low-level ParamInterface::saveSingleLine() calls\n");
+	printf("\nthis example shows how to save a f0 genotype using low-level ParamInterface::saveSingleLine() calls\n");
 
-SString f0_skipping_defaults;
-SString f0_no_skipping_defaults;
+	SString f0_skipping_defaults;
+	SString f0_no_skipping_defaults;
 
-save_as_f0(f0_skipping_defaults,m,true);
-save_as_f0(f0_no_skipping_defaults,m,false);
+	save_as_f0(f0_skipping_defaults, m, true);
+	save_as_f0(f0_no_skipping_defaults, m, false);
 
-printf("\n==== with defdata (skips default values) ======\n%s\n",f0_skipping_defaults.c_str());
-printf("\n==== without defdata (saves all fields) ======\n%s\n",f0_no_skipping_defaults.c_str());
+	printf("\n==== with defdata (skips default values) ======\n%s\n", f0_skipping_defaults.c_str());
+	printf("\n==== without defdata (saves all fields) ======\n%s\n", f0_no_skipping_defaults.c_str());
 
-return 0;
+	return 0;
 }
 
@@ -123,5 +123,5 @@
 
 Source genotype: 'X[|G:1.23]'
-                  ( format 1 )
+				  ( format 1 )
 
 this example shows how to save a f0 genotype using low-level ParamInterface::saveSingleLine() calls
Index: cpp/frams/_demos/full_props.cpp
===================================================================
--- cpp/frams/_demos/full_props.cpp	(revision 955)
+++ cpp/frams/_demos/full_props.cpp	(revision 972)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2016  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -47,57 +47,57 @@
 */
 
-int main(int argc,char*argv[])
+int main(int argc, char*argv[])
 {
-StdioFILE::setStdio();//setup VirtFILE::Vstdin/out/err
-LoggerToStdout messages_to_stderr(LoggerBase::Enable | LoggerBase::DontBlock,VirtFILE::Vstderr); //errors -> stderr, don't interfere with stdout
+	StdioFILE::setStdio();//setup VirtFILE::Vstdin/out/err
+	LoggerToStdout messages_to_stderr(LoggerBase::Enable | LoggerBase::DontBlock, VirtFILE::Vstderr); //errors -> stderr, don't interfere with stdout
 
-PreconfiguredGenetics genetics;
+	PreconfiguredGenetics genetics;
 
-bool reverse=false;
-char* gen_arg=0;
-for(int i=1;i<argc;i++)
+	bool reverse = false;
+	char* gen_arg = 0;
+	for (int i = 1; i < argc; i++)
 	{
-	char* ar=argv[i];
-	if (ar[0]=='-')
-		switch(ar[1])
+		char* ar = argv[i];
+		if (ar[0] == '-')
+			switch (ar[1])
 			{
-			case 'r': reverse=true; break;
+			case 'r': reverse = true; break;
 			case 'h': puts("usage: full_props [-r[everse]] [genotype_or_stdin]\n"); break;
 			}
+		else
+			if (!gen_arg)
+				gen_arg = ar;
+	}
+	SString gen;
+	if (gen_arg)
+		gen = gen_arg;
 	else
-		if (!gen_arg)
-			gen_arg=ar;
-	}
-SString gen;
-if (gen_arg)
-	gen=gen_arg;
-else
-	loadSString(VirtFILE::Vstdin,gen);
-Geno g(gen);
-Model m(g);
+		loadSString(VirtFILE::Vstdin, gen);
+	Geno g(gen);
+	Model m(g, Model::SHAPE_UNKNOWN);
 
-if (!m.isValid())
+	if (!m.isValid())
 	{
-	logPrintf("","full_props",LOG_ERROR,"Cannot build Model from the supplied genotype\n");
-	return 2;	
+		logPrintf("", "full_props", LOG_ERROR, "Cannot build Model from the supplied genotype\n");
+		return 2;
 	}
 
-m.open();
-for(int i=0;i<m.getNeuroCount();i++)
+	m.open();
+	for (int i = 0; i < m.getNeuroCount(); i++)
 	{
-	Neuro *n=m.getNeuro(i);
-	SyntParam p=n->classProperties(reverse);
-	p.update();// ...so everyone reading the source can recognize that p was created to update the neuro d field
-	// but actually, calling update() here is not necessary, because ~SyntParam() would do it anyway
+		Neuro *n = m.getNeuro(i);
+		SyntParam p = n->classProperties(reverse);
+		p.update();// ...so everyone reading the source can recognize that p was created to update the neuro d field
+		// but actually, calling update() here is not necessary, because ~SyntParam() would do it anyway
 	}
-m.close();
+	m.close();
 
-// normal f0 (omitting default values) would be retrieved using m.getF0Geno()
-// the following form allows for more control:
-Geno f0_g;
-m.makeGeno(f0_g,NULL,reverse);//third arg is "handle_defaults" == whether f0 should omit default property values
-puts(f0_g.getGenesAndFormat().c_str());
+	// normal f0 (omitting default values) would be retrieved using m.getF0Geno()
+	// the following form allows for more control:
+	Geno f0_g;
+	m.makeGeno(f0_g, NULL, reverse);//third arg is "handle_defaults" == whether f0 should omit default property values
+	puts(f0_g.getGenesAndFormat().c_str());
 
-return 0;
+	return 0;
 }
 
Index: cpp/frams/_demos/genoconv_test.cpp
===================================================================
--- cpp/frams/_demos/genoconv_test.cpp	(revision 955)
+++ cpp/frams/_demos/genoconv_test.cpp	(revision 972)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2018  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -16,7 +16,7 @@
  */
 
-/// Sample Geno converter not using Model class.
-/// (This converter generates the same output for each input).
-/// Such a converter is responsible for doing valid f0 (or other format) output and storing temporary data.
+ /// Sample Geno converter not using Model class.
+ /// (This converter generates the same output for each input).
+ /// Such a converter is responsible for doing valid f0 (or other format) output and storing temporary data.
 class GenoConv_Test : public GenoConverter
 {
@@ -84,5 +84,5 @@
 	for (t = src; *t; t++)
 	{
-		if (insideneuron&&*t == ']') insideneuron = 0;
+		if (insideneuron && *t == ']') insideneuron = 0;
 		if (*t == '[') insideneuron = 1;
 		if ((!insideneuron) && isdigit(*t) && t[1])
@@ -93,5 +93,5 @@
 				dst += *t;
 			if (map) // fill in the map only if requested
-				map->add(t - src, t - src, dst.len() - n, dst.len() - 1);
+				map->add(t - src, t - src, dst.length() - n, dst.length() - 1);
 			// meaning: source character (t-src) becomes (dst.len()-n ... dst.len()-1)
 		}
@@ -100,5 +100,5 @@
 			dst += *t;
 			if (map)
-				map->add(t - src, t - src, dst.len() - 1, dst.len() - 1);
+				map->add(t - src, t - src, dst.length() - 1, dst.length() - 1);
 			// meaning: map single to single character: (t-src) into (dst.len()-1)
 		}
@@ -113,5 +113,5 @@
 {
 	printf("Genotype:\n%s\nFormat: %s\nValid: %s\nComment: %s\n",
-	       g.getGenes().c_str(), g.getFormat().c_str(), g.isValid() ? "yes" : "no", g.getComment().c_str());
+		g.getGenes().c_str(), g.getFormat().c_str(), g.isValid() ? "yes" : "no", g.getComment().c_str());
 }
 
@@ -167,7 +167,7 @@
 	if (using_checkpoints)
 	{ // using Model with checkpoints
-		Model m1(g2, false, true);//true=using_checkpoints
+		Model m1(g2, Model::SHAPE_UNKNOWN, false, true);//true=using_checkpoints
 		printf("\nModel built from the converted f%s genotype has %d checkpoints\n", g2.getFormat().c_str(), m1.getCheckpointCount());
-		Model m2(g1, false, true);//true=using_checkpoints
+		Model m2(g1, Model::SHAPE_UNKNOWN, false, true);//true=using_checkpoints
 		printf("Model built from the source f%s genotype has %d checkpoints\n", g1.getFormat().c_str(), m2.getCheckpointCount());
 		// accessing individual checkpoint models (if available)
@@ -195,5 +195,5 @@
 		}
 
-		Model mod1(g1, 1);
+		Model mod1(g1, Model::SHAPE_UNKNOWN, 1);
 		printf("\nModel map for f%s genotype:\n", g1.getFormat().c_str());
 		ModelDisplayMap dm1(mod1);
@@ -202,5 +202,5 @@
 		mod1combined.addCombined(mod1.getMap(), dm1.getMap());
 		mod1combined.print();
-		Model mod2(g2, 1);
+		Model mod2(g2, Model::SHAPE_UNKNOWN, 1);
 		printf("\nModel map for f%s genotype:\n", g2.getFormat().c_str());
 		ModelDisplayMap dm2(mod2);
Index: cpp/frams/_demos/genomanipulation.cpp
===================================================================
--- cpp/frams/_demos/genomanipulation.cpp	(revision 955)
+++ cpp/frams/_demos/genomanipulation.cpp	(revision 972)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2019  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -210,5 +210,5 @@
 			else
 				printf("(This class does not have its own properties\n"
-				" - Neuro::classProperties().getPropCount()==0)\n");
+					" - Neuro::classProperties().getPropCount()==0)\n");
 		}
 	}
@@ -230,5 +230,5 @@
 	{
 		SyntParam p = n->classProperties();
-		if (p.getPropCount()>0)
+		if (p.getPropCount() > 0)
 		{
 			printProperties(p);
@@ -284,5 +284,5 @@
 		g.getFormat().c_str(), g.getComment().c_str());
 
-	Model m(g);//.getConverted('0'));
+	Model m(g, Model::SHAPE_UNKNOWN);//.getConverted('0'));
 
 	if (!m.isValid())
Index: cpp/frams/_demos/geometry/geometrytestutils.cpp
===================================================================
--- cpp/frams/_demos/geometry/geometrytestutils.cpp	(revision 955)
+++ cpp/frams/_demos/geometry/geometrytestutils.cpp	(revision 972)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2017  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -24,7 +24,7 @@
 	{
 		count++;
-		totalSize += genotype->genotype.len();
-
-		fprintf(stderr, "%d. (%6d chars) %s\n", count, genotype->genotype.len(),
+		totalSize += genotype->genotype.length();
+
+		fprintf(stderr, "%d. (%6d chars) %s\n", count, genotype->genotype.length(),
 			genotype->name.c_str());
 	}
@@ -63,5 +63,5 @@
 		if ((genoIndex == count) || (strcmp(genotype->name.c_str(), genoName) == 0))
 		{
-			Model model(genotype->genotype);
+			Model model(genotype->genotype, Model::SHAPE_UNKNOWN);
 
 			if (!model.isValid())
Index: cpp/frams/_demos/multiline_f0_test.cpp
===================================================================
--- cpp/frams/_demos/multiline_f0_test.cpp	(revision 955)
+++ cpp/frams/_demos/multiline_f0_test.cpp	(revision 972)
@@ -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-2020  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -13,81 +13,81 @@
 #include <common/virtfile/stringfile.h>
 
-int main(int argc,char*argv[])
+int main(int argc, char*argv[])
 {
-LoggerToStdout messages_to_stdout(LoggerBase::Enable);
-PreconfiguredGenetics genetics;
+	LoggerToStdout messages_to_stdout(LoggerBase::Enable);
+	PreconfiguredGenetics genetics;
 
-SString gen(argc>1?argv[1]:"X[|G:1.23]");
-if (!strcmp(gen.c_str(),"-"))
+	SString gen(argc > 1 ? argv[1] : "X[|G:1.23]");
+	if (!strcmp(gen.c_str(), "-"))
 	{
-	gen=0;
-	StdioFILEDontClose in(stdin);
-	loadSString(&in,gen);
+		gen = 0;
+		StdioFILEDontClose in(stdin);
+		loadSString(&in, gen);
 	}
-Geno g(gen);
-printf("\nSource genotype: '%s'\n",g.getGenes().c_str());
-printf("                  ( format %s %s)\n",
-       g.getFormat().c_str(), g.getComment().c_str());
+	Geno g(gen);
+	printf("\nSource genotype: '%s'\n", g.getGenes().c_str());
+	printf("                  ( format %s %s)\n",
+		g.getFormat().c_str(), g.getComment().c_str());
 
-Model m(g);//.getConverted('0'));
+	Model m(g, Model::SHAPE_UNKNOWN);//.getConverted('0'));
 
-if (!m.isValid())
+	if (!m.isValid())
 	{
-	printf("Cannot build Model from this genotype!\n");
-	return 2;	
+		printf("Cannot build Model from this genotype!\n");
+		return 2;
 	}
-printf("Converted to f0:\n%s\n",m.getF0Geno().getGenes().c_str());
+	printf("Converted to f0:\n%s\n", m.getF0Geno().getGenes().c_str());
 
-printf("\nusing Param::saveMultiLine() to create the \"expanded\" form of the f0 genotype...\n(MultiParamLoader should be able to load this)");
+	printf("\nusing Param::saveMultiLine() to create the \"expanded\" form of the f0 genotype...\n(MultiParamLoader should be able to load this)");
 
-StringFILE2 f;
+	StringFILE2 f;
 
-static Param modelparam(f0_model_paramtab);
-static Param partparam(f0_part_paramtab);
-static Param jointparam(f0_joint_paramtab);
-static Param neuroparam(f0_neuro_paramtab);
-static Param connparam(f0_neuroconn_paramtab);
+	static Param modelparam(f0_model_paramtab);
+	static Param partparam(f0_part_paramtab);
+	static Param jointparam(f0_joint_paramtab);
+	static Param neuroparam(f0_neuro_paramtab);
+	static Param connparam(f0_neuroconn_paramtab);
 
-modelparam.select(&m);
-modelparam.saveMultiLine(&f,"m");
+	modelparam.select(&m);
+	modelparam.saveMultiLine(&f, "m");
 
-Part *p;
-Joint *j;
-Neuro *n;
+	Part *p;
+	Joint *j;
+	Neuro *n;
 
-for (int i=0;p=(Part*)m.getPart(i);i++)
+	for (int i = 0; p = (Part*)m.getPart(i); i++)
 	{
-	partparam.select(p);
-	partparam.saveMultiLine(&f,"p");
+		partparam.select(p);
+		partparam.saveMultiLine(&f, "p");
 	}
-for (int i=0;j=(Joint*)m.getJoint(i);i++)
+	for (int i = 0; j = (Joint*)m.getJoint(i); i++)
 	{
-	jointparam.select(j);
-	jointparam.setParamTab(j->usedelta?f0_joint_paramtab:f0_nodeltajoint_paramtab);
-	jointparam.saveMultiLine(&f,"j");
+		jointparam.select(j);
+		jointparam.setParamTab(j->usedelta ? f0_joint_paramtab : f0_nodeltajoint_paramtab);
+		jointparam.saveMultiLine(&f, "j");
 	}
-for (int i=0;n=(Neuro*)m.getNeuro(i);i++)
+	for (int i = 0; n = (Neuro*)m.getNeuro(i); i++)
 	{
-	neuroparam.select(n);
-	neuroparam.saveMultiLine(&f,"n");
+		neuroparam.select(n);
+		neuroparam.saveMultiLine(&f, "n");
 	}
-for (int a=0;n=(Neuro*)m.getNeuro(a);a++)
+	for (int a = 0; n = (Neuro*)m.getNeuro(a); a++)
 	{ // inputs
-	for (int b=0;b<n->getInputCount();b++)
+		for (int b = 0; b < n->getInputCount(); b++)
 		{
-		double w;
-		NeuroConn nc;
-		Neuro* n2=n->getInput(b,w);
-		nc.n1_refno=n->refno; nc.n2_refno=n2->refno;
-		nc.weight=w;
-		nc.info=n->getInputInfo(b);
-		connparam.select(&nc);
-		connparam.saveMultiLine(&f,"c");
+			double w;
+			NeuroConn nc;
+			Neuro* n2 = n->getInput(b, w);
+			nc.n1_refno = n->refno; nc.n2_refno = n2->refno;
+			nc.weight = w;
+			nc.info = n->getInputInfo(b);
+			connparam.select(&nc);
+			connparam.saveMultiLine(&f, "c");
 		}
 	}
 
-printf("\n============================\n%s\n",f.getString().c_str());
+	printf("\n============================\n%s\n", f.getString().c_str());
 
-return 0;
+	return 0;
 }
 
@@ -95,5 +95,5 @@
 
 Source genotype: 'X[|G:1.23]'
-                  ( format 1 )
+				  ( format 1 )
 Converted to f0:
 p:
Index: cpp/frams/_demos/neuro_layout_test.cpp
===================================================================
--- cpp/frams/_demos/neuro_layout_test.cpp	(revision 955)
+++ cpp/frams/_demos/neuro_layout_test.cpp	(revision 972)
@@ -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-2020  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -21,118 +21,118 @@
 
 // stl is fun? ;-) ForwardIterator implementation for element coordinates (required by min_element/max_element)
-template <int MEMBER> struct NNIter: public std::iterator<std::forward_iterator_tag,int> //MEMBER: 0..3=x/y/w/h
+template <int MEMBER> struct NNIter : public std::iterator<std::forward_iterator_tag, int> //MEMBER: 0..3=x/y/w/h
 {
-NNLayoutState *nn; int index;
-NNIter() {}
-NNIter(NNLayoutState *_nn, int _index):nn(_nn),index(_index) {}
-int operator*() {return nn->GetXYWH(index)[MEMBER];}
-NNIter& operator++() {index++; return *this;}
-bool operator!=(const NNIter& it) {return index!=it.index;}
-bool operator==(const NNIter& it) {return index==it.index;}
+	NNLayoutState *nn; int index;
+	NNIter() {}
+	NNIter(NNLayoutState *_nn, int _index) :nn(_nn), index(_index) {}
+	int operator*() { return nn->GetXYWH(index)[MEMBER]; }
+	NNIter& operator++() { index++; return *this; }
+	bool operator!=(const NNIter& it) { return index != it.index; }
+	bool operator==(const NNIter& it) { return index == it.index; }
 
-static NNIter begin(NNLayoutState *_nn) {return NNIter(_nn,0);}
-static NNIter end(NNLayoutState *_nn) {return NNIter(_nn,_nn->GetElements());}
+	static NNIter begin(NNLayoutState *_nn) { return NNIter(_nn, 0); }
+	static NNIter end(NNLayoutState *_nn) { return NNIter(_nn, _nn->GetElements()); }
 };
 
 class Screen
 {
-int min_x,max_x,min_y,max_y,scale_x,scale_y;
-int rows,columns;
-char* screen;
+	int min_x, max_x, min_y, max_y, scale_x, scale_y;
+	int rows, columns;
+	char* screen;
 
 public:
 
-Screen(int _min_x,int _max_x,int _min_y,int _max_y,int _scale_x,int _scale_y)
-	:min_x(_min_x),max_x(_max_x),min_y(_min_y),max_y(_max_y),scale_x(_scale_x),scale_y(_scale_y)
+	Screen(int _min_x, int _max_x, int _min_y, int _max_y, int _scale_x, int _scale_y)
+		:min_x(_min_x), max_x(_max_x), min_y(_min_y), max_y(_max_y), scale_x(_scale_x), scale_y(_scale_y)
+	{
+		columns = (max_x - min_x + scale_x - 1) / scale_x;
+		rows = (max_y - min_y + scale_y - 1) / scale_y;
+		screen = new char[rows * columns];
+		memset(screen, ' ', rows * columns);
+	}
+
+	~Screen()
+	{
+		delete[] screen;
+	}
+
+	void put(int x, int y, const char *str)
+	{
+		x = (x - min_x) / scale_x;
+		y = (y - min_y) / scale_y;
+		if (x < 0) return;
+		if (y < 0) return;
+		if (y >= rows) return;
+		for (; *str; str++, x++)
 		{
-		columns=(max_x-min_x+scale_x-1)/scale_x;
-		rows=(max_y-min_y+scale_y-1)/scale_y;
-		screen=new char[rows*columns];
-		memset(screen,' ',rows*columns);
-		}
-
-~Screen()
-		{
-		delete[] screen;
-		}
-
-void put(int x,int y,const char *str)
-	{
-	x=(x-min_x)/scale_x;
-	y=(y-min_y)/scale_y;
-	if (x<0) return;
-	if (y<0) return;
-	if (y>=rows) return;
-	for(;*str;str++,x++)
-		{
-		if (x>=columns) return;
-		screen[columns*y+x]=*str;
+			if (x >= columns) return;
+			screen[columns * y + x] = *str;
 		}
 	}
 
-void print()
+	void print()
 	{
-	for(int y=0;y<rows;y++)
+		for (int y = 0; y < rows; y++)
 		{
-		fwrite(&screen[columns*y],1,columns,stdout);
-		printf("\n");
+			fwrite(&screen[columns * y], 1, columns, stdout);
+			printf("\n");
 		}
 	}
 };
 
-int main(int argc,char*argv[])
+int main(int argc, char*argv[])
 {
-LoggerToStdout messages_to_stdout(LoggerBase::Enable);
-PreconfiguredGenetics genetics;
+	LoggerToStdout messages_to_stdout(LoggerBase::Enable);
+	PreconfiguredGenetics genetics;
 
-if (argc<=1)
+	if (argc <= 1)
 	{
 		puts("Parameters:\n"
-		     " 1. Genotype (or - character indicating the genotype will be read from stdin)\n"
-		     " 2. (Optional) layout type (the only useful layout is 2, which is the default, see nn_simple_layout.cpp");
-	  return 10;
+			" 1. Genotype (or - character indicating the genotype will be read from stdin)\n"
+			" 2. (Optional) layout type (the only useful layout is 2, which is the default, see nn_simple_layout.cpp");
+		return 10;
 	}
-SString gen(argv[1]);
-if (!strcmp(gen.c_str(),"-"))
+	SString gen(argv[1]);
+	if (!strcmp(gen.c_str(), "-"))
 	{
-	gen=0;
-	StdioFILEDontClose in(stdin);
-	loadSString(&in,gen);
+		gen = 0;
+		StdioFILEDontClose in(stdin);
+		loadSString(&in, gen);
 	}
-int layout_type=2;
-if (argc>2) layout_type=atol(argv[2]);
-Geno g(gen);
-if (!g.isValid()) {puts("invalid genotype");return 5;}
-Model m(g);
-if (!m.getNeuroCount()) {puts("no neural network");return 1;}
-printf("%d neurons,",m.getNeuroCount());
+	int layout_type = 2;
+	if (argc > 2) layout_type = atol(argv[2]);
+	Geno g(gen);
+	if (!g.isValid()) { puts("invalid genotype"); return 5; }
+	Model m(g, Model::SHAPE_UNKNOWN);
+	if (!m.getNeuroCount()) { puts("no neural network"); return 1; }
+	printf("%d neurons,", m.getNeuroCount());
 
-NNLayoutState_Model nn_layout(&m);
-struct NNLayoutFunction &nnfun=nn_layout_functions[layout_type];
-printf(" using layout type=%d (%s)\n",layout_type,nnfun.name);
-nnfun.doLayout(&nn_layout);
+	NNLayoutState_Model nn_layout(&m);
+	struct NNLayoutFunction &nnfun = nn_layout_functions[layout_type];
+	printf(" using layout type=%d (%s)\n", layout_type, nnfun.name);
+	nnfun.doLayout(&nn_layout);
 
-for(int i=0;i<nn_layout.GetElements();i++)
+	for (int i = 0; i < nn_layout.GetElements(); i++)
 	{
-	int *xywh=nn_layout.GetXYWH(i);
-	printf("#%-3d %s\t%d,%d\t%dx%d\n",i,m.getNeuro(i)->getClassName().c_str(),
-	       xywh[0],xywh[1],xywh[2],xywh[3]);
+		int *xywh = nn_layout.GetXYWH(i);
+		printf("#%-3d %s\t%d,%d\t%dx%d\n", i, m.getNeuro(i)->getClassName().c_str(),
+			xywh[0], xywh[1], xywh[2], xywh[3]);
 	}
 
-Screen screen(*std::min_element(NNIter<0>::begin(&nn_layout),NNIter<0>::end(&nn_layout))-30,
-	      *std::max_element(NNIter<0>::begin(&nn_layout),NNIter<0>::end(&nn_layout))+70,
-	      *std::min_element(NNIter<1>::begin(&nn_layout),NNIter<1>::end(&nn_layout)),
-	      *std::max_element(NNIter<1>::begin(&nn_layout),NNIter<1>::end(&nn_layout))+30,
-	      10,35);
+	Screen screen(*std::min_element(NNIter<0>::begin(&nn_layout), NNIter<0>::end(&nn_layout)) - 30,
+		*std::max_element(NNIter<0>::begin(&nn_layout), NNIter<0>::end(&nn_layout)) + 70,
+		*std::min_element(NNIter<1>::begin(&nn_layout), NNIter<1>::end(&nn_layout)),
+		*std::max_element(NNIter<1>::begin(&nn_layout), NNIter<1>::end(&nn_layout)) + 30,
+		10, 35);
 
-printf("===========================================\n");
-for(int i=0;i<nn_layout.GetElements();i++)
+	printf("===========================================\n");
+	for (int i = 0; i < nn_layout.GetElements(); i++)
 	{
-	int *xywh=nn_layout.GetXYWH(i);
-	SString label=SString::sprintf("%d:%s",i,m.getNeuro(i)->getClassName().c_str());
-	screen.put(xywh[0],xywh[1],label.c_str());
+		int *xywh = nn_layout.GetXYWH(i);
+		SString label = SString::sprintf("%d:%s", i, m.getNeuro(i)->getClassName().c_str());
+		screen.put(xywh[0], xywh[1], label.c_str());
 	}
-screen.print();
-printf("===========================================\n");
+	screen.print();
+	printf("===========================================\n");
 
 }
Index: cpp/frams/_demos/neuro_test.cpp
===================================================================
--- cpp/frams/_demos/neuro_test.cpp	(revision 955)
+++ cpp/frams/_demos/neuro_test.cpp	(revision 972)
@@ -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-2020  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -18,9 +18,9 @@
 #ifndef SDK_WITHOUT_FRAMS
 #include <frams/mech/creatmechobj.h>
-int CreatMechObject::modeltags_id=0;
-int CreatMechObject::mechtags_id=0;
+int CreatMechObject::modeltags_id = 0;
+int CreatMechObject::mechtags_id = 0;
 #endif
 
-ParamEntry creature_paramtab[]={0};
+ParamEntry creature_paramtab[] = { 0 };
 
 #ifdef VEYETEST
@@ -33,107 +33,107 @@
 #define LEARNINGSTEPS 50
 
-void veyeStep(Model &m,int step)
+void veyeStep(Model &m, int step)
 {
-  static float angle=0;
+	static float angle = 0;
 
-  NeuroNetImpl::getImpl(m.getNeuro(N_Mode))->setState(step>=LEARNINGSTEPS); //0 (learning) or 1 (normal)
+	NeuroNetImpl::getImpl(m.getNeuro(N_Mode))->setState(step >= LEARNINGSTEPS); //0 (learning) or 1 (normal)
 
-	NeuroImpl *ni=NeuroNetImpl::getImpl(m.getNeuro(N_VEye));
-  ((NI_VectorEye*)ni)->relpos.y=0;
-  ((NI_VectorEye*)ni)->relpos.z=0;
-  if (NeuroNetImpl::getImpl(m.getNeuro(N_Mode))->getNewState()<0.5)
-  { //learning
-    ((NI_VectorEye*)ni)->relpos.x=5.0*sin(2*M_PI*step/LEARNINGSTEPS);
-  }
-  else
-  { //VMotor controls location of VEye
-    angle+=NeuroNetImpl::getImpl(m.getNeuro(N_VMotor))->getState();
-    angle=fmod((double)angle,M_PI*2.0);
-    ((NI_VectorEye*)ni)->relpos.x=5*sin(angle);
-  }
+	NeuroImpl *ni = NeuroNetImpl::getImpl(m.getNeuro(N_VEye));
+	((NI_VectorEye*)ni)->relpos.y = 0;
+	((NI_VectorEye*)ni)->relpos.z = 0;
+	if (NeuroNetImpl::getImpl(m.getNeuro(N_Mode))->getNewState() < 0.5)
+	{ //learning
+		((NI_VectorEye*)ni)->relpos.x = 5.0 * sin(2 * M_PI * step / LEARNINGSTEPS);
+	}
+	else
+	{ //VMotor controls location of VEye
+		angle += NeuroNetImpl::getImpl(m.getNeuro(N_VMotor))->getState();
+		angle = fmod((double)angle, M_PI * 2.0);
+		((NI_VectorEye*)ni)->relpos.x = 5 * sin(angle);
+	}
 
-  NeuroNetImpl::getImpl(m.getNeuro(N_Fitness))->setState(angle); //wymaga poprawy
-  //oraz trzeba przemyslec kolejnosc get/set'ow neuronow zeby sygnal sie dobrze propagowal.
+	NeuroNetImpl::getImpl(m.getNeuro(N_Fitness))->setState(angle); //wymaga poprawy
+	//oraz trzeba przemyslec kolejnosc get/set'ow neuronow zeby sygnal sie dobrze propagowal.
 }
 #endif
 
-int main(int argc,char*argv[])
+int main(int argc, char*argv[])
 {
-LoggerToStdout messages_to_stdout(LoggerBase::Enable);
-PreconfiguredGenetics genetics;
+	LoggerToStdout messages_to_stdout(LoggerBase::Enable);
+	PreconfiguredGenetics genetics;
 
-if (argc<=1)
+	if (argc <= 1)
 	{
 		puts("Parameters: <genotype> [number of simulation steps]");
-	  return 10;
+		return 10;
 	}
-SString gen(argv[1]);
-if (!strcmp(gen.c_str(),"-"))
+	SString gen(argv[1]);
+	if (!strcmp(gen.c_str(), "-"))
 	{
-	gen=0;
-	StdioFILEDontClose in(stdin);
-	loadSString(&in,gen);
+		gen = 0;
+		StdioFILEDontClose in(stdin);
+		loadSString(&in, gen);
 	}
-Geno g(gen);
-if (!g.isValid()) {puts("invalid genotype");return 5;}
-Model m(g);
-if (!m.getNeuroCount()) {puts("no neural network");return 1;}
-printf("%d neurons,",m.getNeuroCount());
-NeuroFactory neurofac;
-neurofac.setStandardImplementation();
-NeuroNetConfig nn_config(&neurofac);
-NeuroNetImpl *nn=new NeuroNetImpl(m,nn_config);
-int i; Neuro *n;
-if (!nn->getErrorCount()) printf(" no errors\n");
-else
+	Geno g(gen);
+	if (!g.isValid()) { puts("invalid genotype"); return 5; }
+	Model m(g, Model::SHAPE_UNKNOWN);
+	if (!m.getNeuroCount()) { puts("no neural network"); return 1; }
+	printf("%d neurons,", m.getNeuroCount());
+	NeuroFactory neurofac;
+	neurofac.setStandardImplementation();
+	NeuroNetConfig nn_config(&neurofac);
+	NeuroNetImpl *nn = new NeuroNetImpl(m, nn_config);
+	int i; Neuro *n;
+	if (!nn->getErrorCount()) printf(" no errors\n");
+	else
 	{
-	printf(" %d errors:",nn->getErrorCount());
-	int no_impl=0; SString no_impl_names;
-	int init_err=0; SString init_err_names;
-	for(i=0;i<m.getNeuroCount();i++)
+		printf(" %d errors:", nn->getErrorCount());
+		int no_impl = 0; SString no_impl_names;
+		int init_err = 0; SString init_err_names;
+		for (i = 0; i < m.getNeuroCount(); i++)
 		{
-		n=m.getNeuro(i);
-		NeuroImpl *ni=NeuroNetImpl::getImpl(n);
-		if (!ni)
+			n = m.getNeuro(i);
+			NeuroImpl *ni = NeuroNetImpl::getImpl(n);
+			if (!ni)
 			{
-			if (no_impl) no_impl_names+=',';
-			no_impl_names+=SString::sprintf("#%d.%s",i,n->getClassName().c_str());
-			no_impl++;
+				if (no_impl) no_impl_names += ',';
+				no_impl_names += SString::sprintf("#%d.%s", i, n->getClassName().c_str());
+				no_impl++;
 			}
-		else if (ni->status==NeuroImpl::InitError)
+			else if (ni->status == NeuroImpl::InitError)
 			{
-			if (init_err) init_err_names+=',';
-			init_err_names+=SString::sprintf("#%d.%s",i,n->getClassName().c_str());
-			init_err++;
+				if (init_err) init_err_names += ',';
+				init_err_names += SString::sprintf("#%d.%s", i, n->getClassName().c_str());
+				init_err++;
 			}
 		}
+		printf("\n");
+		if (no_impl) printf("%d x missing implementation (%s)\n", no_impl, no_impl_names.c_str());
+		if (init_err) printf("%d x failed initialization (%s)\n", init_err, init_err_names.c_str());
+	}
+	int steps = 1;
+	if (argc > 2) steps = atol(argv[2]);
+	int st;
+	printf("step");
+	for (i = 0; i < m.getNeuroCount(); i++)
+	{
+		n = m.getNeuro(i);
+		printf("\t#%d.%s", i, n->getClassName().c_str());
+	}
 	printf("\n");
-	if (no_impl) printf("%d x missing implementation (%s)\n",no_impl,no_impl_names.c_str());
-	if (init_err) printf("%d x failed initialization (%s)\n",init_err,init_err_names.c_str());
-	}
-int steps=1;
-if (argc>2) steps=atol(argv[2]);
-int st;
-printf("step");
-for(i=0;i<m.getNeuroCount();i++)
-	{
-	n=m.getNeuro(i);
-	printf("\t#%d.%s",i,n->getClassName().c_str());
-	}
-printf("\n");
-for(st=0;st<=steps;st++)
+	for (st = 0; st <= steps; st++)
 	{
 #ifdef VEYETEST
-  veyeStep(m,st);
+		veyeStep(m, st);
 #endif
-	printf("%d",st);
-	for(i=0;i<m.getNeuroCount();i++)
+		printf("%d", st);
+		for (i = 0; i < m.getNeuroCount(); i++)
 		{
-		n=m.getNeuro(i);
-		printf("\t%g",n->state);
+			n = m.getNeuro(i);
+			printf("\t%g", n->state);
 		}
-	printf("\n");
-	nn->simulateNeuroNet();
+		printf("\n");
+		nn->simulateNeuroNet();
 	}
-neurofac.freeImplementation();
+	neurofac.freeImplementation();
 }
Index: cpp/frams/_demos/shapeconvert.cpp
===================================================================
--- cpp/frams/_demos/shapeconvert.cpp	(revision 955)
+++ cpp/frams/_demos/shapeconvert.cpp	(revision 972)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2016  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -46,5 +46,5 @@
 		if (ar[0] == '-')
 			switch (ar[1])
-		{
+			{
 			case 's': shape = (Part::Shape)atol(ar + 2);
 				if ((shape != Part::SHAPE_ELLIPSOID) && (shape != Part::SHAPE_CUBOID) && (shape != Part::SHAPE_CYLINDER))
@@ -56,5 +56,5 @@
 			case 't': thickness = atof(ar + 2); break;
 			case 'h': puts("Usage: shapeconvert [-sSHAPE] [-tTHICKNESS] [genotype_or_stdin]\n\tSHAPE: 1=ellipsoid, 2=cuboid, 3(default)=cylinder\n\tTHICKNESS: used for Part.sy/sz (default=0.2)"); break;
-		}
+			}
 		else
 			if (!gen_arg)
@@ -67,5 +67,5 @@
 		loadSString(VirtFILE::Vstdin, gen);
 	Geno g(gen);
-	Model m(g);
+	Model m(g, Model::SHAPE_UNKNOWN);
 
 	if (!m.isValid())
