Index: experiments/frams/foraminifera/data/scripts/foraminifera.expdef
===================================================================
--- experiments/frams/foraminifera/data/scripts/foraminifera.expdef	(revision 638)
+++ experiments/frams/foraminifera/data/scripts/foraminifera.expdef	(revision 847)
@@ -60,5 +60,5 @@
 	pop.othermask = 0;
 	//pop.selfmask = 0x20002; pop.othermask = 0x10002;
-	pop.perfperiod = 25; 
+	pop.perfperiod = 25;
 	pop.bodysim = 0;
 
@@ -86,10 +86,10 @@
 	World.wrldwat = 200;
 	World.wrldsiz = micronsToFrams(100000);
-	wrldsizSquareMeters = Math.pow(framsToMicrons(World.wrldsiz)*0.000001,2);
+	wrldsizSquareMeters = Math.pow(framsToMicrons(World.wrldsiz) * 0.000001, 2);
 	World.wrldbnd = 1;
 
 	//ExpProperties.visualize = 1; //uncomment to visualize reticulopodia and indicate nutrients positions
 
-	//ExpProperties.logging = 1; //uncomment to enable logging simulation parameters to log files	
+	//ExpProperties.logging = 1; //uncomment to enable logging simulation parameters to log files
 	ExpProperties.logPref = "";
 
@@ -99,5 +99,5 @@
 	ExpProperties.chamber_proculus_haplo = micronsToFrams(20);
 	ExpProperties.chamber_proculus_diplo = micronsToFrams(10);
-	colors = ["1.0,1.0,0.3","1.0,0.7,0.0"]; //yellow and orange
+	colors = ["1.0,1.0,0.3", "1.0,0.7,0.0"]; //yellow and orange
 	curColor = colors[0];
 	curRadius = ExpProperties.zone1_range;
@@ -105,7 +105,7 @@
 	//nutrients
 	ExpProperties.nutrientradius = micronsToFrams(10);
-	ExpProperties.energy_nut = 200 * energyFromVolume(ExpProperties.nutrientradius,1);
+	ExpProperties.energy_nut = 200 * energyFromVolume(ExpProperties.nutrientradius, 1);
 	nutrientSqrCm = 10;
-	ExpProperties.nutrient_pop = Math.pow(framsToMicrons(World.wrldsiz)*0.0001,2)/nutrientSqrCm;
+	ExpProperties.nutrient_pop = Math.pow(framsToMicrons(World.wrldsiz) * 0.0001, 2) / nutrientSqrCm;
 
 	ExpState.totaltestedcr = 0;
@@ -116,5 +116,5 @@
 	//addSpecies({"min_repro_energies" : [4,6]});
 	//addSpecies({"min_repro_energies" : [4,8]});
-	
+
 	//Simulator.print(create_genotype(0.2, 30, "1.0,1.0,0.0", 0.6)); //sample call
 	//Simulator.print(create_genotype(0.1, 40, "1.0,0.5,0.0", 0.1)); //sample call
@@ -135,6 +135,6 @@
 	if (ExpProperties.max_chamber_num_haplo == max_chambers_def && ExpProperties.max_chamber_num_diplo == max_chambers_def)
 	{
-		max_chamber_volume = [[30403.5869594578,52812.2546633948,79578.5148482541,113588.815134453,154620.677376218,205094.322220826,262572.712174265,326078.453295303,402342.518962956,498133.985678766,615066.864740109,759500.497626816,937064.025544282,1155915.25563075,1429139.14079748,1762487.92940157,2176286.62046069,2685795.63187845,3316190.12127043,4096436.04462706,5051343.25226193,6231980.1061213,7687880.79524734,9485307.02904958,11716968.9852569,14459866.4934433,17836388.9853663,22004935.7247348,27138607.2546045,33482425.1582986,41336775.1280297,50997910.7842793,62888631.7871037,77563060.9243464,95659468.591964]
-, [3430.07716920763,6159.93090353532,9322.94192815286,13462.9896597283,18399.8550832969,24558.9218126892,31468.8148639192,39189.4977865513,48404.4292075836,60185.8639086061,74490.6048472854,92117.8178412275,113852.779747083,140714.366929552,174450.937643841,215250.242147183,266323.295274072,328858.042352538,406552.379957238,503526.321155323,621060.781025019,767240.824049468,947210.683224091,1169506.19906112,1447211.61255879,1787155.29073739,2205627.64766244,2723413.2837305,3360233.53738709,4147771.02835393,5126445.06973928,6328060.3331703,7805693.278958,9631924.72156452,11884287.1596814]];
+		max_chamber_volume = [[30403.5869594578, 52812.2546633948, 79578.5148482541, 113588.815134453, 154620.677376218, 205094.322220826, 262572.712174265, 326078.453295303, 402342.518962956, 498133.985678766, 615066.864740109, 759500.497626816, 937064.025544282, 1155915.25563075, 1429139.14079748, 1762487.92940157, 2176286.62046069, 2685795.63187845, 3316190.12127043, 4096436.04462706, 5051343.25226193, 6231980.1061213, 7687880.79524734, 9485307.02904958, 11716968.9852569, 14459866.4934433, 17836388.9853663, 22004935.7247348, 27138607.2546045, 33482425.1582986, 41336775.1280297, 50997910.7842793, 62888631.7871037, 77563060.9243464, 95659468.591964]
+		                      , [3430.07716920763, 6159.93090353532, 9322.94192815286, 13462.9896597283, 18399.8550832969, 24558.9218126892, 31468.8148639192, 39189.4977865513, 48404.4292075836, 60185.8639086061, 74490.6048472854, 92117.8178412275, 113852.779747083, 140714.366929552, 174450.937643841, 215250.242147183, 266323.295274072, 328858.042352538, 406552.379957238, 503526.321155323, 621060.781025019, 767240.824049468, 947210.683224091, 1169506.19906112, 1447211.61255879, 1787155.29073739, 2205627.64766244, 2723413.2837305, 3360233.53738709, 4147771.02835393, 5126445.06973928, 6328060.3331703, 7805693.278958, 9631924.72156452, 11884287.1596814]];
 	}
 
@@ -143,11 +143,11 @@
 		max_chamber_volume = [Vector.new(), Vector.new()];
 		var density = 100;
-		for (var ploid = 0; ploid < 2; ploid++) 
+		for (var ploid = 0; ploid < 2; ploid++)
 		{
 			var rad = getPloidRadius(ploid);
-			for (var cham_num = 0; cham_num < getProperty(ploid,"max_chamber_num"); cham_num++)
+			for (var cham_num = 0; cham_num < getProperty(ploid, "max_chamber_num"); cham_num++)
 			{
-				max_chamber_volume[ploid].add(volumeFromGeno(ploid, rad, cham_num+1, density));
-			}                                  
+				max_chamber_volume[ploid].add(volumeFromGeno(ploid, rad, cham_num + 1, density));
+			}
 		}
 	}
@@ -162,5 +162,5 @@
 		for (var i = 0; i < ExpProperties.foramPop; i++)
 		{
-			addInitialForam(spec, i);	
+			addInitialForam(spec, i);
 		}
 	}
@@ -239,19 +239,20 @@
 {
 	var geno = create_genotype(rad, chamber_num, colors[morphotype], 1);
-	var m=Model.newFromString(geno);
-	var mg=ModelGeometry.forModel(m);
-	mg.geom_density=density; 
+	var m = Model.newFromString(geno);
+	var mg = ModelGeometry.forModel(m);
+	mg.geom_density = density;
 	var volumeInFrams = mg.volume();
 
-	return volumeInFrams/Math.pow(ExpProperties.scalingFactor,3);
-}
-
-function secToSimSteps(value_in_sec){
-	return value_in_sec/ExpProperties.secPerStep;
+	return volumeInFrams / Math.pow(ExpProperties.scalingFactor, 3);
+}
+
+function secToSimSteps(value_in_sec)
+{
+	return value_in_sec / ExpProperties.secPerStep;
 }
 
 function volumeInMicrons(radiusInFrams)
 {
-	return 4.0/3.0*Math.pi*Math.pow(framsToMicrons(radiusInFrams),3);
+	return 4.0 / 3.0 * Math.pi * Math.pow(framsToMicrons(radiusInFrams), 3);
 }
 
@@ -260,5 +261,5 @@
 	if (isRadiusInFrams == 1) //radius in frams
 	{
-		return ExpProperties.picoCarbonPerMikro*volumeInMicrons(base);
+		return ExpProperties.picoCarbonPerMikro * volumeInMicrons(base);
 	}
 	else //volume in microns
@@ -270,15 +271,15 @@
 function getMovePerStep()
 {
-	return micronsToFrams((ExpProperties.foramSpeedMmPerMin/60)*1000)*ExpProperties.secPerStep;
+	return micronsToFrams((ExpProperties.foramSpeedMmPerMin / 60) * 1000) * ExpProperties.secPerStep;
 }
 
 function micronsToFrams(micrometers)
 {
-	return micrometers*ExpProperties.scalingFactor;
+	return micrometers * ExpProperties.scalingFactor;
 }
 
 function framsToMicrons(framsworldunits)
 {
-	return framsworldunits/ExpProperties.scalingFactor;
+	return framsworldunits / ExpProperties.scalingFactor;
 }
 
@@ -292,7 +293,7 @@
 function getGene(cr, gen_id, gen_set)
 {
-	if (cr.data->lifeparams->gen == 0) 
+	if (cr.data->lifeparams->gen == 0)
 		return cr.data->genes[gen_id];
-	else 
+	else
 		return cr.data->genes[gen_set][gen_id];
 }
@@ -301,8 +302,8 @@
 {
 	var radius = ExpProperties.chamber_proculus_haplo;
-		if (ploid == 1)
-		{
-			radius = ExpProperties.chamber_proculus_diplo;
-		}
+	if (ploid == 1)
+	{
+		radius = ExpProperties.chamber_proculus_diplo;
+	}
 	return radius;
 }
@@ -313,11 +314,11 @@
 	for (var i = 0; i < chamber_num; i++)
 	{
-		if (energy < energyFromVolume(max_chamber_volume[ploid][i],0))
-		{
-			chamber_num = i+1;
+		if (energy < energyFromVolume(max_chamber_volume[ploid][i], 0))
+		{
+			chamber_num = i + 1;
 			break;
-		}	
-	}                                  
-	
+		}
+	}
+
 	return chamber_num;
 }
@@ -326,6 +327,6 @@
 {
 	var cr = Populations[pop_num].add(geno);
-	cr.rotate(0,0,Math.rndUni(rotate_min, rotate_max));
-	return cr;	
+	cr.rotate(0, 0, Math.rndUni(rotate_min, rotate_max));
+	return cr;
 }
 
@@ -337,5 +338,5 @@
 	var geno = create_genotype(radius, chambernum, colors[ploid], 1);
 	curColor = colors[ploid];
-	var cr = createAndRotate(geno, 0, 2*Math.pi, 0);
+	var cr = createAndRotate(geno, 0, 2 * Math.pi, 0);
 	cr.name = "Initial creature" + species + "_" + iter;
 	placeRandomlyNotColliding(cr);
@@ -355,9 +356,9 @@
 	{
 		ploid = 1;
-	}	
+	}
 	//add new foram with random energy bewtween starting energy and reproduction threshold
 	var repro_thr = species_genes[species]->min_repro_energies[ploid];
-	var start_energy = Math.rndUni(energyFromVolume(getPloidRadius(ploid),1),repro_thr-0.25*repro_thr);
-	addForam(species, iter, start_energy,ploid);
+	var start_energy = Math.rndUni(energyFromVolume(getPloidRadius(ploid), 1), repro_thr - 0.25 * repro_thr);
+	addForam(species, iter, start_energy, ploid);
 }
 
@@ -365,10 +366,10 @@
 function addSpecies(new_genes)
 {
-	species_genes.add({"min_repro_energies" : [ExpProperties.min_repro_energ_haplo,ExpProperties.min_repro_energ_diplo], "energies0" : [ExpProperties.energies0_haplo, ExpProperties.energies0_diplo], "hibernation" : 0, "morphotype" : 0});
+	species_genes.add({"min_repro_energies" : [ExpProperties.min_repro_energ_haplo, ExpProperties.min_repro_energ_diplo], "energies0" : [ExpProperties.energies0_haplo, ExpProperties.energies0_diplo], "hibernation" : 0, "morphotype" : 0});
 	for (var i = 0; i < new_genes.size; i++)
 	{
 		var key = new_genes.getKey(i);
-		species_genes[species_genes.size-1][key] = new_genes[key];
-	} 
+		species_genes[species_genes.size - 1][key] = new_genes[key];
+	}
 }
 
@@ -378,5 +379,5 @@
 {
 	//percent of current energy
-	cr.idleen = (ExpProperties.e_meta * cr.energy)*ExpProperties.secPerStep;
+	cr.idleen = (ExpProperties.e_meta * cr.energy) * ExpProperties.secPerStep;
 }
 
@@ -388,17 +389,17 @@
 function getZoneRange(cr, zone_num)
 {
-	return ExpProperties.["zone"+zone_num+"_range"];
+	return ExpProperties.["zone" + zone_num + "_range"];
 }
 
 function addReticulopodia(cr, radius)
 {
-		if (reticulopodiaExists(cr))
-		{
-			Populations[2].delete(cr.data->reticulopodiacreature);
-		}
-		var ret = Populations[2].add("//0\nm:Vstyle=reticulopodia\np:sh=1,sx=0.001,sy=0.001,sz=0.001\np:sh=3,sx=0.01,sy="+radius+",sz="+radius+",ry=1.57079633,vr="+curColor+"\nj:0, 1, sh=1");
-		cr.data->reticulopodiacreature = ret;
-		ret.getMechPart(0).orient.set(cr.getMechPart(0).orient);
-		ret.locationSetBboxLow(cr.bboxCenter.x-radius, cr.bboxCenter.y-radius, cr.bboxCenter.z-radius);
+	if (reticulopodiaExists(cr))
+	{
+		Populations[2].delete(cr.data->reticulopodiacreature);
+	}
+	var ret = Populations[2].add("//0\nm:Vstyle=reticulopodia\np:sh=1,sx=0.001,sy=0.001,sz=0.001\np:sh=3,sx=0.01,sy=" + radius + ",sz=" + radius + ",ry=1.57079633,vr=" + curColor + "\nj:0, 1, sh=1");
+	cr.data->reticulopodiacreature = ret;
+	ret.getMechPart(0).orient.set(cr.getMechPart(0).orient);
+	ret.locationSetBboxLow(cr.bboxCenter.x - radius, cr.bboxCenter.y - radius, cr.bboxCenter.z - radius);
 }
 
@@ -421,5 +422,5 @@
 		if (!cr.boundingBoxCollisions(0))
 		{
-			cr.locationSetBboxLow(cr.bboxLow.x, cr.bboxLow.y, -cr.getPart(cr.numparts-1).sx); //place slightly under the bottom surface ("z" value depends on the size of the last=largest chamber)
+			cr.locationSetBboxLow(cr.bboxLow.x, cr.bboxLow.y, -cr.getPart(cr.numparts - 1).sx); //place slightly under the bottom surface ("z" value depends on the size of the last=largest chamber)
 			return cr;
 		}
@@ -451,9 +452,9 @@
 function foramGrow(cr, chamber_num, lastchambergrowth)
 {
-	if ((chamber_num+1) <= max_chamber_volume[cr.data->lifeparams->gen].size)
+	if ((chamber_num + 1) <= max_chamber_volume[cr.data->lifeparams->gen].size)
 	{
 		curColor = colors[cr.data->lifeparams->gen];
 		var ploid = cr.data->lifeparams->gen;
-		var geno = create_genotype(getPloidRadius(ploid), chamber_num+1, colors[ploid], lastchambergrowth);
+		var geno = create_genotype(getPloidRadius(ploid), chamber_num + 1, colors[ploid], lastchambergrowth);
 		var cr2 = createAndRotate(geno, 0, 0, 0);
 
@@ -463,5 +464,5 @@
 
 		setGenotype({"cr" : cr2, "parent_genes" : cr.data->genes, "parent_lifeparams" : cr.data->lifeparams, "opt" : "growth", "energy0" : cr.energy0});
-		cr2.locationSetBboxLow(cr.bboxLow.x, cr.bboxLow.y,cr.bboxLow.z);
+		cr2.locationSetBboxLow(cr.bboxLow.x, cr.bboxLow.y, cr.bboxLow.z);
 		setForamMeta(cr2);
 
@@ -479,29 +480,29 @@
 {
 	var total_time = secToSimSteps(ExpProperties.chamberGrowthSec);
-	var ret_unit = total_time/chamber_vis_denominator;
-	var chamber_unit = total_time-ret_unit;
+	var ret_unit = total_time / chamber_vis_denominator;
+	var chamber_unit = total_time - ret_unit;
 
 	if (chamber_time < ret_unit || chamber_time >= chamber_unit)
 	{
-		var new_rad = Math.min(Math.max((chamber_time%ret_unit)/ret_unit*getZoneRange(cr,1),0.01),getZoneRange(cr,1));
+		var new_rad = Math.min(Math.max((chamber_time % ret_unit) / ret_unit * getZoneRange(cr, 1), 0.01), getZoneRange(cr, 1));
 
 		if(chamber_time < ret_unit)
 		{
-			new_rad = getZoneRange(cr,1)-new_rad;
+			new_rad = getZoneRange(cr, 1) - new_rad;
 		}
 
 		curColor = colors[cr.data->lifeparams->gen];
-		addReticulopodia(cr,new_rad);
+		addReticulopodia(cr, new_rad);
 
 		if (chamber_time == 0)//checking for end of chamber growth process
 		{
-			cr.data->lifeparams->chamber_growth = -1;	
+			cr.data->lifeparams->chamber_growth = -1;
 		}
 	}
 	else
 	{
-		var new_rad = 1 - Math.min(Math.max((chamber_time-ret_unit)/chamber_unit,0.01),1);
+		var new_rad = 1 - Math.min(Math.max((chamber_time - ret_unit) / chamber_unit, 0.01), 1);
 		curRadius = cr.data->reticulopodiacreature.getPart(1).sy;
-				
+
 		if (chamber_time == ret_unit)
 		{
@@ -509,6 +510,6 @@
 		}
 
-		var new_cr = foramGrow(cr, chamberNumFromEnergy(cr.data->lifeparams->max_energy_level, cr.data->lifeparams->gen)-1, new_rad);
-		curRadius = getZoneRange(new_cr,1);
+		var new_cr = foramGrow(cr, chamberNumFromEnergy(cr.data->lifeparams->max_energy_level, cr.data->lifeparams->gen) - 1, new_rad);
+		curRadius = getZoneRange(new_cr, 1);
 	}
 }
@@ -517,5 +518,5 @@
 {
 	var p = XYZ.new(cr.bboxCenter.x, cr.bboxCenter.y, cr.bboxCenter.z);
-	var n = cr.signals.receiveSet("nutrient", getZoneRange(cr,2));
+	var n = cr.signals.receiveSet("nutrient", getZoneRange(cr, 2));
 
 	//if signals are received find the source of the nearest
@@ -536,5 +537,5 @@
 			distvec.sub(p);
 			dist = distvec.length;
-			if (dist < getZoneRange(cr,1))
+			if (dist < getZoneRange(cr, 1))
 			{
 				if (n[i].value != null)
@@ -562,5 +563,5 @@
 		return 1;
 	}
-	
+
 	else
 	{
@@ -574,5 +575,5 @@
 	{
 		//percent of maximal energy
-		cr.energy -= (ExpProperties.energy_move * cr.data->lifeparams->max_energy_level)*ExpProperties.secPerStep;
+		cr.energy -= (ExpProperties.energy_move * cr.data->lifeparams->max_energy_level) * ExpProperties.secPerStep;
 	}
 }
@@ -580,5 +581,5 @@
 function fence(center, zone)
 {
-	return Math.min(Math.max(0+zone,center),World.wrldsiz-zone); //add and subtract zone from the world size to prevent reticulopodia from crossing the fence
+	return Math.min(Math.max(0 + zone, center), World.wrldsiz - zone); //add and subtract zone from the world size to prevent reticulopodia from crossing the fence
 }
 
@@ -588,6 +589,6 @@
 	{
 		var moved = stepToNearest(cr); //TODO weighted sum of distance and energy
-		if (moved==1)
-		{ 
+		if (moved == 1)
+		{
 			moveReticulopodia(cr);
 			return;
@@ -595,5 +596,5 @@
 	}
 
-	//Prevents forams from crossing the world border. In the case of touching the border with the reticulopodia direction of the movement should be changed. 
+	//Prevents forams from crossing the world border. In the case of touching the border with the reticulopodia direction of the movement should be changed.
 	var change_direction = 0;
 	var new_x = fence(cr.bboxCenter.x, getZoneRange(cr, 1));
@@ -603,12 +604,12 @@
 	{
 		change_direction = 1;
-		cr.locationSetBboxLow(new_x-cr.bboxSize.x/2, new_y-cr.bboxSize.y/2, -cr.getPart(cr.numparts-1).sx);//place slightly under the bottom surface ("z" value depends on the size of the last=largest chamber)
+		cr.locationSetBboxLow(new_x - cr.bboxSize.x / 2, new_y - cr.bboxSize.y / 2, -cr.getPart(cr.numparts - 1).sx); //place slightly under the bottom surface ("z" value depends on the size of the last=largest chamber)
 	}
 
 	//no nutrients in zone 2
-	if (getGene(cr, "hibernation",0) == 1)
+	if (getGene(cr, "hibernation", 0) == 1)
 	{
 		reverseHib(cr);
-		cr.drive = XYZ.new(0,0,0);
+		cr.drive = XYZ.new(0, 0, 0);
 	}
 	//random move
@@ -631,5 +632,5 @@
 	if (visualization(cr))
 	{
-		cr.data->reticulopodiacreature.locationSetBboxLow(cr.bboxCenter.x-getZoneRange(cr,1), cr.bboxCenter.y-getZoneRange(cr,1), cr.bboxCenter.z-getZoneRange(cr,1));
+		cr.data->reticulopodiacreature.locationSetBboxLow(cr.bboxCenter.x - getZoneRange(cr, 1), cr.bboxCenter.y - getZoneRange(cr, 1), cr.bboxCenter.z - getZoneRange(cr, 1));
 		cr.data->reticulopodiacreature.drive = cr.drive;
 	}
@@ -638,7 +639,7 @@
 function randomDir()
 {
-	var dir = (Math.rndUni(-ExpProperties.zone2_range, ExpProperties.zone2_range), Math.rndUni(-ExpProperties.zone2_range, ExpProperties.zone2_range), 0);	
+	var dir = (Math.rndUni(-ExpProperties.zone2_range, ExpProperties.zone2_range), Math.rndUni(-ExpProperties.zone2_range, ExpProperties.zone2_range), 0);
 	dir.normalize();
-	dir.scale(-1*movePerStep);
+	dir.scale(-1 * movePerStep);
 	return dir;
 }
@@ -646,9 +647,9 @@
 function energyTransfer(cr1, cr2)
 {
-	cr1.drive = XYZ.new(0,0,0);
-	var e =  ExpProperties.feedtrans*cr1.energy*ExpProperties.secPerStep; //TODO efficiency dependent on age
+	cr1.drive = XYZ.new(0, 0, 0);
+	var e =  ExpProperties.feedtrans * cr1.energy * ExpProperties.secPerStep; //TODO efficiency dependent on age
 	//Simulator.print("transferring "+e +"("+e*ExpProperties.ingestion+")"+" to "+cr1.name +" ("+ cr1.energy+") " +" from "+cr2.uid+" ("+cr2.energy+") "+ e/ExpProperties.secPerStep+ " per sec");
 	var transferred = cr2.transferEnergyTo(cr1, e);
-	cr1.energy -= transferred*(1-ExpProperties.ingestion);
+	cr1.energy -= transferred * (1 - ExpProperties.ingestion);
 	if (cr1.data->lifeparams->hibernated == 1)
 	{
@@ -662,8 +663,8 @@
 	{
 		setForamMeta(cr); //unhibernate
-	} 
+	}
 	else
 	{
-		cr.idleen = (ExpProperties.energy_hib * cr.energy)*ExpProperties.secPerStep; //hibernate
+		cr.idleen = (ExpProperties.energy_hib * cr.energy) * ExpProperties.secPerStep; //hibernate
 	}
 	cr.data->lifeparams->hibernated = 1 - cr.data->lifeparams->hibernated;
@@ -675,5 +676,5 @@
 	if (cr.data->lifeparams->division_time > 0)
 	{
-		cr.data->lifeparams->division_time = Math.max(cr.data->lifeparams->division_time-1,0);
+		cr.data->lifeparams->division_time = Math.max(cr.data->lifeparams->division_time - 1, 0);
 	}
 	//checking for end of gametogenesis
@@ -685,5 +686,5 @@
 	else if (cr.data->lifeparams->chamber_growth > 0)
 	{
-		var chamber_time = Math.max(cr.data->lifeparams->chamber_growth-1,0);
+		var chamber_time = Math.max(cr.data->lifeparams->chamber_growth - 1, 0);
 		cr.data->lifeparams->chamber_growth = chamber_time;
 		cr.energy -= ExpProperties.chamberCostPerSec * cr.energy * ExpProperties.secPerStep;
@@ -695,7 +696,7 @@
 	}
 	//checking for end of the chamber growth process
-	else if (cr.data->lifeparams->chamber_growth == 0 && visualization(cr)==0)
-	{	
-		foramGrow(cr, lastChamberNum(cr), 1); 
+	else if (cr.data->lifeparams->chamber_growth == 0 && visualization(cr) == 0)
+	{
+		foramGrow(cr, lastChamberNum(cr), 1);
 		cr.data->lifeparams->chamber_growth = -1;
 		//Simulator.print("chamber "+ (lastChamberNum(cr) + 1) +" complete");
@@ -713,7 +714,7 @@
 			if (ExpProperties.logging == 1)
 			{
-				log(createLogVector(cr, cr.data->lifeparams->max_energy_level),ExpProperties.logPref+"fossil_log.txt");
-				log(createLogVector(cr, cr.lifespan),ExpProperties.logPref+"lifespan_log.txt");
-			}			
+				log(createLogVector(cr, cr.data->lifeparams->max_energy_level), ExpProperties.logPref + "fossil_log.txt");
+				log(createLogVector(cr, cr.lifespan), ExpProperties.logPref + "lifespan_log.txt");
+			}
 			Populations[0].kill(cr);
 			return;
@@ -736,15 +737,15 @@
 		if  (lastChamberNum(cr) < max_chamber_volume[cr.data->lifeparams->gen].size)
 		{
-			if ((cr.data->lifeparams->max_energy_level >= energyFromVolume(max_chamber_volume[cr.data->lifeparams->gen][lastChamberNum(cr)-1],0))) 	
+			if ((cr.data->lifeparams->max_energy_level >= energyFromVolume(max_chamber_volume[cr.data->lifeparams->gen][lastChamberNum(cr) - 1], 0)))
 			{
 				cr.data->lifeparams->chamber_growth = int(secToSimSteps(ExpProperties.chamberGrowthSec));
-			}	
-		}
-	}	
+			}
+		}
+	}
 }
 
 function deathConditions(cr)
 {
-	if ((cr.energy <= getProperty(cr.data->lifeparams->gen,"e_death_level")*cr.data->lifeparams->max_energy_level) || (Math.rnd01 < ExpProperties.hunted_prob))
+	if ((cr.energy <= getProperty(cr.data->lifeparams->gen, "e_death_level")*cr.data->lifeparams->max_energy_level) || (Math.rnd01 < ExpProperties.hunted_prob))
 	{
 		return 1;
@@ -774,5 +775,5 @@
 function createNutrientGenotype(nutrientradius)
 {
-	return "//0\nm:Vstyle=nutrient\np:sh=3,sx="+nutrientradius+",sy="+nutrientradius+",sz="+nutrientradius+",ry=1.57,vr=0.0,1.0,0.0";
+	return "//0\nm:Vstyle=nutrient\np:sh=3,sx=" + nutrientradius + ",sy=" + nutrientradius + ",sz=" + nutrientradius + ",ry=1.57,vr=0.0,1.0,0.0";
 }
 
@@ -797,8 +798,8 @@
 	if (ExpProperties.visualize == 1)
 	{
-		var nutsize = ExpProperties.nutrientradius*10;
-		var nut = Populations[2].add("//0\nm:Vstyle=nutrient_visual\np:sh=2,sx="+nutsize+",sy="+nutsize+",sz="+nutsize+",ry=1.5,vr=0.0,1.0,0.0");
+		var nutsize = ExpProperties.nutrientradius * 10;
+		var nut = Populations[2].add("//0\nm:Vstyle=nutrient_visual\np:sh=2,sx=" + nutsize + ",sy=" + nutsize + ",sz=" + nutsize + ",ry=1.5,vr=0.0,1.0,0.0");
 		cr.data->reticulopodiacreature = nut;
-		nut.locationSetBboxLow( cr.bboxLow.x+cr.bboxSize.x/2-nut.bboxSize.x/2,  cr.bboxLow.y+cr.bboxSize.y/2-nut.bboxSize.y/2, -nutsize); 
+		nut.locationSetBboxLow( cr.bboxLow.x + cr.bboxSize.x / 2 - nut.bboxSize.x / 2,  cr.bboxLow.y + cr.bboxSize.y / 2 - nut.bboxSize.y / 2, -nutsize);
 	}
 }
@@ -815,6 +816,6 @@
 {
 	counter += increase;
-	var unitcount = int(counter/unitsize);
-	counter -= unitcount*unitsize;
+	var unitcount = int(counter / unitsize);
+	counter -= unitcount * unitsize;
 	return {"counter" : counter, "number" : unitcount};
 }
@@ -824,26 +825,26 @@
 	if (ExpProperties.foodfluxChange > 0)
 	{
-			changePeriod += 1;
-			if (phase=="low" && changePeriod >= secToSimSteps(23328000)) //9 months
-			{
-				ExpProperties.foodflux = ExpProperties.foodflux/ExpProperties.foodfluxChange;
-				phase = "high";
-				changePeriod = 0;
-			}
-		
-			else if (phase == "high" && changePeriod >= secToSimSteps(7776000)) //3 months
-			{
-				ExpProperties.foodflux = ExpProperties.foodflux*ExpProperties.foodfluxChange;
-				phase = "low";
-				changePeriod = 0;
-			}
-	}
-
-	var nutrientNum = getNumberCounter(nutrient_num_counter, ExpProperties.foodflux*wrldsizSquareMeters*ExpProperties.secPerStep,ExpProperties.energy_nut*0.000000000001); 
+		changePeriod += 1;
+		if (phase == "low" && changePeriod >= secToSimSteps(23328000)) //9 months
+		{
+			ExpProperties.foodflux = ExpProperties.foodflux / ExpProperties.foodfluxChange;
+			phase = "high";
+			changePeriod = 0;
+		}
+
+		else if (phase == "high" && changePeriod >= secToSimSteps(7776000)) //3 months
+		{
+			ExpProperties.foodflux = ExpProperties.foodflux * ExpProperties.foodfluxChange;
+			phase = "low";
+			changePeriod = 0;
+		}
+	}
+
+	var nutrientNum = getNumberCounter(nutrient_num_counter, ExpProperties.foodflux * wrldsizSquareMeters * ExpProperties.secPerStep, ExpProperties.energy_nut * 0.000000000001);
 
 	nutrient_num_counter = nutrientNum["counter"];
 
 	for (var i = 0; i < nutrientNum["number"]; i++)
-	{    
+	{
 		addNutrient();
 	}
@@ -851,5 +852,5 @@
 	if (ExpProperties.logging == 1 && nutrientNum["number"] > 0)
 	{
-		log([nutrientNum["number"]],ExpProperties.logPref+"nutrients_log.txt");
+		log([nutrientNum["number"]], ExpProperties.logPref + "nutrients_log.txt");
 	}
 
@@ -878,5 +879,5 @@
 			reproduce_parents(s);
 		}
-		
+
 	}
 
@@ -903,5 +904,5 @@
 
 function createStatistics()
-{	
+{
 	var number = [];
 	var e_inc = [];
@@ -910,6 +911,6 @@
 	for (var s = 0; s < species_genes.size; s++)
 	{
-		number.add([0,0]);// [haplo][diplo]
-		e_inc.add([0,0]);
+		number.add([0, 0]); // [haplo][diplo]
+		e_inc.add([0, 0]);
 	}
 
@@ -920,5 +921,5 @@
 		var species = cr.data->lifeparams->species;
 
-		number[species][gen] = number[species][gen] + 1; 
+		number[species][gen] = number[species][gen] + 1;
 		e_inc[species][gen] = e_inc[species][gen] + cr.energy;
 	}
@@ -941,15 +942,15 @@
 		}
 	}
-	
+
 	log_numbers.add(Populations[1].size);
 	log_energies.add(e_nut);
 
-	log(log_numbers, ExpProperties.logPref+"forams_log.txt");
-    log(log_energies,  ExpProperties.logPref+"energies_log.txt");
+	log(log_numbers, ExpProperties.logPref + "forams_log.txt");
+	log(log_energies,  ExpProperties.logPref + "energies_log.txt");
 }
 
 function log(tolog, fname)
 {
-	var f = File.appendDirect(fname, "forams data"); 
+	var f = File.appendDirect(fname, "forams data");
 	f.writeString("" + Simulator.stepNumber);
 	for (var  i = 0; i < tolog.size; i++)
@@ -972,5 +973,5 @@
 		if (cr.data->lifeparams->species == i)
 		{
-			vec[i*2+cr.data->lifeparams->gen] = value;		
+			vec[i * 2 + cr.data->lifeparams->gen] = value;
 		}
 	}
Index: experiments/frams/foraminifera/data/scripts/foraminifera.inc
===================================================================
--- experiments/frams/foraminifera/data/scripts/foraminifera.inc	(revision 638)
+++ experiments/frams/foraminifera/data/scripts/foraminifera.inc	(revision 847)
@@ -2,25 +2,25 @@
 function create_genotype(proculus_size, number_of_chambers, rgbstring, lastchambergrowth) //lastchambergrowth is 0..1
 {
-	const shift=0.7;
-	const angle_delta=0.8;
-	const angle_delta_delta=-0.01;
-	const growing=1.07; //7% growth
-	
-	var str="//0\nm:Vstyle=foram\n";
-	var size=proculus_size;
-	for(var i=0;i<number_of_chambers;i++)
-	{
-		var effectivesize=size; //'effectivesize' is introduced only to consider the last chamber
-		if (i==number_of_chambers-1) //last chamber
-		{
-			effectivesize*=lastchambergrowth;
-			size=size*(1.35-0.35*lastchambergrowth); //last iteration: 'size' is only used for shifting (dx). The last chamber emerges at the surface of the previous one
-			if (lastchambergrowth<1)
-				rgbstring="0.9,0.9,0.9,i=\"growing=%g\"" % lastchambergrowth; //when the last chamber is growing, make it bright gray and add extra information in its "i" field
+	const shift = 0.7;
+	const angle_delta = 0.8;
+	const angle_delta_delta = -0.01;
+	const growing = 1.07; //7% growth
+
+	var str = "//0\nm:Vstyle=foram\n";
+	var size = proculus_size;
+	for(var i = 0; i < number_of_chambers; i++)
+	{
+		var effectivesize = size; //'effectivesize' is introduced only to consider the last chamber
+		if (i == number_of_chambers - 1) //last chamber
+		{
+			effectivesize *= lastchambergrowth;
+			size = size * (1.35 - 0.35 * lastchambergrowth); //last iteration: 'size' is only used for shifting (dx). The last chamber emerges at the surface of the previous one
+			if (lastchambergrowth < 1)
+				rgbstring = "0.9,0.9,0.9,i=\"growing=%g\"" % lastchambergrowth; //when the last chamber is growing, make it bright gray and add extra information in its "i" field
 		}
 		str += "p:sh=1,sx=%g,sy=%g,sz=%g,rz=3.14159265358979,vr=%s\n" % effectivesize % effectivesize % effectivesize % rgbstring;
-		if (i>0)
-			str+="j:%d,%d,sh=1,dx=%g,rz=%g\n" % (i-1) % i % (size*shift) % (angle_delta+i*angle_delta_delta);
-		size*=growing;
+		if (i > 0)
+			str += "j:%d,%d,sh=1,dx=%g,rz=%g\n" % (i - 1) % i % (size * shift) % (angle_delta + i * angle_delta_delta);
+		size *= growing;
 	}
 	return str;
@@ -38,18 +38,18 @@
 	{
 		foram_uid += 1;
-		var new_id = "c"+string(foram_uid);
+		var new_id = "c" + string(foram_uid);
 		mode->cr.data->genes = String.deserialize(String.serialize(mode->genes));
-		mode->cr.data->lifeparams = {"max_energy_level" : mode->energy0, "gen" : mode->gen,  "hibernated" : 0, "species" : mode->species, "reproduce" : 0, "dir" : randomDir(), "dir_counter" : Math.random(int(secToSimSteps(ExpProperties.dir_change_sec))), "chamber_growth" : -1, "division_time" : -1, "uid" : new_id};	
+		mode->cr.data->lifeparams = {"max_energy_level" : mode->energy0, "gen" : mode->gen,  "hibernated" : 0, "species" : mode->species, "reproduce" : 0, "dir" : randomDir(), "dir_counter" : Math.random(int(secToSimSteps(ExpProperties.dir_change_sec))), "chamber_growth" : -1, "division_time" : -1, "uid" : new_id};
 
 		var oper = "cloning";
 		var inherit = [1.0];
 		if (mode->parentsuids.size > 1)
-		{	
+		{
 			oper = "cross-over";
 			inherit = [0.5, 0.5];
 		}
-		
-		var dict={"Time":Simulator.stepNumber,"FromIDs":mode->parentsuids,"ID":new_id, "Inherited":inherit, "Operation": oper, "Kind" : mode->gen};
-		Simulator.print("[OFFSPRING] " + String.serialize(dict));		
+
+		var dict = {"Time": Simulator.stepNumber, "FromIDs": mode->parentsuids, "ID": new_id, "Inherited": inherit, "Operation": oper, "Kind" : mode->gen};
+		Simulator.print("[OFFSPRING] " + String.serialize(dict));
 	}
 }
@@ -57,5 +57,5 @@
 function getEnergy0(radius)
 {
-	return energyFromVolume(micronsToFrams(radius),1);
+	return energyFromVolume(micronsToFrams(radius), 1);
 }
 
@@ -64,7 +64,7 @@
 	var number = 1;
 	var result = parent_energy;
-	while ((result-ExpProperties.divisionCost) >= energy0)
-	{
-		result = (result-ExpProperties.divisionCost)/2;
+	while ((result - ExpProperties.divisionCost) >= energy0)
+	{
+		result = (result - ExpProperties.divisionCost) / 2;
 		number *= 2;
 	}
@@ -74,9 +74,9 @@
 
 function reproduce_haploid(parent, parent2, clone)
-{	
+{
 	var number, energy0, new_genes, gen;
 	if (clone == 1)
 	{
-		var offspring = gametsDivision(parent.energy,getEnergy0(getGene(parent,"energies0",0)[0])); 
+		var offspring = gametsDivision(parent.energy, getEnergy0(getGene(parent, "energies0", 0)[0]));
 		energy0 = offspring->energy;
 		number = offspring->number;
@@ -87,8 +87,8 @@
 	else
 	{
-		var offspring1 = gametsDivision(parent.energy,getEnergy0(getGene(parent,"energies0", 0)[1])); 
-		var offspring2 = gametsDivision(parent2.energy,getEnergy0(getGene(parent2,"energies0", 0)[1])); 
-		energy0 = (offspring1->energy+offspring2->energy); 
-		number = ExpProperties.gametSuccessRate*(offspring1->number+offspring2->number)/2;
+		var offspring1 = gametsDivision(parent.energy, getEnergy0(getGene(parent, "energies0", 0)[1]));
+		var offspring2 = gametsDivision(parent2.energy, getEnergy0(getGene(parent2, "energies0", 0)[1]));
+		energy0 = (offspring1->energy + offspring2->energy);
+		number = ExpProperties.gametSuccessRate * (offspring1->number + offspring2->number) / 2;
 		new_genes = [parent.data->genes, parent2.data->genes];
 		gen = 1 - parent.data->lifeparams->gen;
@@ -96,10 +96,10 @@
 		if (ExpProperties.logging == 1)
 		{
-				log(createLogVector(parent, parent.energy),ExpProperties.logPref+"repro_energies_log.txt");
-				log(createLogVector(parent2, parent2.energy),ExpProperties.logPref+"repro_energies_log.txt");
-				log(createLogVector(parent, number),ExpProperties.logPref+"repro_num_log.txt");
-				log(createLogVector(parent, parent.lifespan),ExpProperties.logPref+"lifespan_log.txt");
-				log(createLogVector(parent2, parent2.lifespan),ExpProperties.logPref+"lifespan_log.txt");
-		}	
+			log(createLogVector(parent, parent.energy), ExpProperties.logPref + "repro_energies_log.txt");
+			log(createLogVector(parent2, parent2.energy), ExpProperties.logPref + "repro_energies_log.txt");
+			log(createLogVector(parent, number), ExpProperties.logPref + "repro_num_log.txt");
+			log(createLogVector(parent, parent.lifespan), ExpProperties.logPref + "lifespan_log.txt");
+			log(createLogVector(parent2, parent2.lifespan), ExpProperties.logPref + "lifespan_log.txt");
+		}
 	}
 
@@ -114,14 +114,14 @@
 function reproduce_diploid(parent)
 {
-	var offspring = gametsDivision(parent.energy,getEnergy0(getGene(parent,"energies0", 0)[0]));
-	var energy0 = offspring->energy; 
+	var offspring = gametsDivision(parent.energy, getEnergy0(getGene(parent, "energies0", 0)[0]));
+	var energy0 = offspring->energy;
 	var number = offspring->number;
 
-		if (ExpProperties.logging == 1)
-		{
-			log(createLogVector(parent, parent.energy),ExpProperties.logPref+"repro_energies_log.txt");
-			log(createLogVector(parent, number),ExpProperties.logPref+"repro_num_log.txt");
-			log(createLogVector(parent, parent.lifespan),ExpProperties.logPref+"lifespan_log.txt");
-		}	
+	if (ExpProperties.logging == 1)
+	{
+		log(createLogVector(parent, parent.energy), ExpProperties.logPref + "repro_energies_log.txt");
+		log(createLogVector(parent, number), ExpProperties.logPref + "repro_num_log.txt");
+		log(createLogVector(parent, parent.lifespan), ExpProperties.logPref + "lifespan_log.txt");
+	}
 
 	//Simulator.print("diploid number of offspring: " + number+ " energ0: " + energy0);
@@ -139,5 +139,5 @@
 		for (var k = 0; k < 2; k++)
 		{
-			createOffspring(create_genotype(ExpProperties.chamber_proculus_haplo, 1, colors[0], 1), energy0, parent.data->genes[0], parent.data->lifeparams, [parent.data->lifeparams->uid]); 
+			createOffspring(create_genotype(ExpProperties.chamber_proculus_haplo, 1, colors[0], 1), energy0, parent.data->genes[0], parent.data->lifeparams, [parent.data->lifeparams->uid]);
 		}
 
@@ -148,5 +148,5 @@
 			crossed = 0;
 		}
-			
+
 	}
 }
@@ -154,49 +154,49 @@
 function reproduce_parents(species)
 {
-		var parent1 = null;
-		var parent2 = null;
-		var pop = Populations[0];
-		for (var i = pop.size-1; i >= 0; i--)
-		{
-   			if (pop[i].data->lifeparams->reproduce == 1 && pop[i].data->lifeparams->species == species) 
-   			{ 
-				if ((pop[i].data->lifeparams->gen==1) || ((pop[i].data->lifeparams->gen==0) && ExpProperties.stress == 0))
+	var parent1 = null;
+	var parent2 = null;
+	var pop = Populations[0];
+	for (var i = pop.size - 1; i >= 0; i--)
+	{
+		if (pop[i].data->lifeparams->reproduce == 1 && pop[i].data->lifeparams->species == species)
+		{
+			if ((pop[i].data->lifeparams->gen == 1) || ((pop[i].data->lifeparams->gen == 0) && ExpProperties.stress == 0))
+			{
+				continue;
+			}
+			else if (parent1 == null)
+			{
+				parent1 = pop[i];
+			}
+			else if (parent2 == null)
+			{
+				parent2 = pop[i];
+			}
+			if (parent1 != null && parent2 != null)
+			{
+				//when parents are ready for reproduction start gametogenesis
+				if (parent1.data->lifeparams->division_time == -1 && parent2.data->lifeparams->division_time == -1)
 				{
-					continue;
+					var time = int(secToSimSteps(ExpProperties.gametoPeriodSec));
+					parent1.data->lifeparams->division_time = time;
+					parent2.data->lifeparams->division_time = time;
+					parent1.idleen = 0;
+					parent2.idleen = 0;
+					//Simulator.print("parents "+parent1.uid + " " + parent2.uid + " ready to repro: "+Simulator.stepNumber);
 				}
-      				else if (parent1 == null)
+				//when gametogenesis is finished fuse gamets
+				else if (parent1.data->lifeparams->division_time == 0 && parent2.data->lifeparams->division_time == 0)
 				{
-					parent1 = pop[i];
+					reproduce_haploid(parent1, parent2, 0);
+					//print_repro_info(parent1);
+					//print_repro_info(parent2);
+					pop.kill(parent1);
+					pop.kill(parent2);
+					parent1 = null;
+					parent2 = null;
 				}
-				else if (parent2 == null)
-				{
-					parent2 = pop[i];
-				}  
-				if (parent1 != null && parent2 != null)
-				{
-					//when parents are ready for reproduction start gametogenesis
-					if (parent1.data->lifeparams->division_time == -1 && parent2.data->lifeparams->division_time == -1)
-					{
-						var time = int(secToSimSteps(ExpProperties.gametoPeriodSec));
-						parent1.data->lifeparams->division_time = time;
-						parent2.data->lifeparams->division_time = time;
-						parent1.idleen = 0;
-						parent2.idleen = 0;
-						//Simulator.print("parents "+parent1.uid + " " + parent2.uid + " ready to repro: "+Simulator.stepNumber);
-					}
-					//when gametogenesis is finished fuse gamets 
-					else if (parent1.data->lifeparams->division_time == 0 && parent2.data->lifeparams->division_time == 0)
-					{
-						reproduce_haploid(parent1, parent2, 0);
-						//print_repro_info(parent1);
-						//print_repro_info(parent2);
-						pop.kill(parent1);
-						pop.kill(parent2);
-						parent1 = null;
-						parent2 = null;
-					}
-				}	
-   			} 
-		}
+			}
+		}
+	}
 }
 
@@ -219,5 +219,5 @@
 		if (cr.signals.size == 0)
 		{
-			cr.signals.add("repro"+cr.data->lifeparams->species);
+			cr.signals.add("repro" + cr.data->lifeparams->species);
 			cr.signals[0].power = 1;
 		}
@@ -237,6 +237,6 @@
 function foramReproduce(cr)
 {
-	var properEnergy = cr.energy >= getGene(cr, "min_repro_energies",0)[cr.data->lifeparams->gen];
-	var reproduced = 0;	
+	var properEnergy = cr.energy >= getGene(cr, "min_repro_energies", 0)[cr.data->lifeparams->gen];
+	var reproduced = 0;
 
 	//if creature has proper energy
@@ -248,10 +248,10 @@
 			reproduced = readyToRepro(cr);
 		}
-		else if (cr.signals.receive("repro"+cr.data->lifeparams->species) > 0)
+		else if (cr.signals.receive("repro" + cr.data->lifeparams->species) > 0)
 		{
 			reproduced = readyToRepro(cr);
 		}
 		if (reproduced == 1)
-				return 1;
+			return 1;
 	}
 
@@ -259,5 +259,5 @@
 	{
 		cr.signals.clear();
-		cr.data->lifeparams->reproduce = 0; 
+		cr.data->lifeparams->reproduce = 0;
 	}
 
@@ -274,6 +274,6 @@
 function createOffspring(geno, energy, parent_genes, parent_lifeparams, parentsuids)
 {
-	curColor = colors[1-parent_lifeparams->gen];
-	var cr = createAndRotate(geno, 0, 2*Math.pi, 0);
+	curColor = colors[1 - parent_lifeparams->gen];
+	var cr = createAndRotate(geno, 0, 2 * Math.pi, 0);
 	cr.energy0 = energy;
 	cr.energy = cr.energy0;
Index: experiments/frams/foraminifera/data/scripts/foraminifera.show
===================================================================
--- experiments/frams/foraminifera/data/scripts/foraminifera.show	(revision 638)
+++ experiments/frams/foraminifera/data/scripts/foraminifera.show	(revision 847)
@@ -19,13 +19,13 @@
 {
 	var nutrient_multiple = 200;
-	Params = { "foodflux" : [0.0000000037815,0.0000000075631,0.000000015126], "feedtrans" : [0.0005,0.001,0.002],"energy_nut" :[nutrient_multiple*144.54,nutrient_multiple*544.54,nutrient_multiple*944.54], "stress" : [0,1], "visualize" : [0,1]};
-	ShowProperties.visualize=1;
-	ExpProperties.secPerStep=50;
+	Params = { "foodflux" : [0.0000000037815, 0.0000000075631, 0.000000015126], "feedtrans" : [0.0005, 0.001, 0.002], "energy_nut" : [nutrient_multiple * 144.54, nutrient_multiple * 544.54, nutrient_multiple * 944.54], "stress" : [0, 1], "visualize" : [0, 1]};
+	ShowProperties.visualize = 1;
+	ExpProperties.secPerStep = 50;
 	Simulator.init();
-	last_simspeed=0;
+	last_simspeed = 0;
 	GLDisplay.desiredsimspeed = 50;
 	GLDisplay.minfps = 10;
 	TrackingCam.cam_h = 15; //more side view
-	
+
 	//useful for screenshots:
 	//GLDisplay.world_visibility=2+4; //show only environment and creatures (no background)
@@ -36,23 +36,23 @@
 {
 	//just a draft, this function and all constants in expdef need serious review
-	var localDriveMicronsPerStep=framsToMicrons(getMovePerStep());
-	var foramSpeedMmPerSec=ExpProperties.foramSpeedMmPerMin/60;
-	var localDriveMmPerStep=localDriveMicronsPerStep/1000;
-	var localDriveMmPerSec=localDriveMmPerStep*Simulator.simspeed;
-	return localDriveMmPerSec/foramSpeedMmPerSec;
+	var localDriveMicronsPerStep = framsToMicrons(getMovePerStep());
+	var foramSpeedMmPerSec = ExpProperties.foramSpeedMmPerMin / 60;
+	var localDriveMmPerStep = localDriveMicronsPerStep / 1000;
+	var localDriveMmPerSec = localDriveMmPerStep * Simulator.simspeed;
+	return localDriveMmPerSec / foramSpeedMmPerSec;
 }
 
 function updateBanner()
 {
-	GLDisplay.banner="World size is %g mm." % (framsToMicrons(World.wrldsiz)/1000);
-	GLDisplay.banner+="\nShowing real-time x %g." % timeScale();
+	GLDisplay.banner = "World size is %g mm." % (framsToMicrons(World.wrldsiz) / 1000);
+	GLDisplay.banner += "\nShowing real-time x %g." % timeScale();
 }
 
 function onShowStep()
 {
-	if (Simulator.simspeed<last_simspeed*0.9 || Simulator.simspeed>last_simspeed*1.1) //significant change
+	if (Simulator.simspeed < last_simspeed * 0.9 || Simulator.simspeed > last_simspeed * 1.1) //significant change
 	{
 		updateBanner();
-		last_simspeed=Simulator.simspeed;
+		last_simspeed = Simulator.simspeed;
 	}
 }
