Repository: nrv-framework/NRV (language: python)

Issue:
Gmem
adding g_mem recorder for unmyelinated models 
+ 
multiple CL_postprocessing 


Discussion / hints:

Fix patch:
diff --git a/nrv/_misc/mods/AXNODE.mod b/nrv/_misc/mods/AXNODE.mod
index d1db4d22..33bd1058 100644
--- a/nrv/_misc/mods/AXNODE.mod
+++ b/nrv/_misc/mods/AXNODE.mod
@@ -16,97 +16,104 @@ TITLE Motor Axon Node channels
 INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
 
 NEURON {
-	SUFFIX axnode
-	NONSPECIFIC_CURRENT ina
-	NONSPECIFIC_CURRENT inap
-	NONSPECIFIC_CURRENT ik
-	NONSPECIFIC_CURRENT il
-	RANGE gnapbar, gnabar, gkbar, gl, ena, ek, el
-	RANGE mp_inf, m_inf, h_inf, s_inf
-	RANGE tau_mp, tau_m, tau_h, tau_s
+    SUFFIX axnode
+    NONSPECIFIC_CURRENT ina
+    NONSPECIFIC_CURRENT inap
+    NONSPECIFIC_CURRENT ik
+    NONSPECIFIC_CURRENT il
+    RANGE gnapbar, gnabar, gkbar, gl, ena, ek, el
+    RANGE gnap, gna, gk
+    RANGE mp_inf, m_inf, h_inf, s_inf
+    RANGE tau_mp, tau_m, tau_h, tau_s
 }
 
 
 UNITS {
-	(mA) = (milliamp)
-	(mV) = (millivolt)
+    (mA) = (milliamp)
+    (mV) = (millivolt)
 }
 
 PARAMETER {
 
-	gnapbar = 0.01	(mho/cm2)
-	gnabar	= 3.0	(mho/cm2)
-	gkbar   = 0.08 	(mho/cm2)
-	gl	= 0.007 (mho/cm2)
-	ena     = 50.0  (mV)
-	ek      = -90.0 (mV)
-	el	= -90.0 (mV)
-	celsius		(degC)
-	dt              (ms)
-	v               (mV)
-	vtraub=-80
-	ampA = 0.01
-	ampB = 27
-	ampC = 10.2
-	bmpA = 0.00025
-	bmpB = 34
-	bmpC = 10
-	amA = 1.86
-	amB = 21.4
-	amC = 10.3
-	bmA = 0.086
-	bmB = 25.7
-	bmC = 9.16
-	ahA = 0.062
-	ahB = 114.0
-	ahC = 11.0
-	bhA = 2.3
-	bhB = 31.8
-	bhC = 13.4
-	asA = 0.3
-	asB = -27
-	asC = -5
-	bsA = 0.03
-	bsB = 10
-	bsC = -1
+    gnapbar = 0.01	(mho/cm2)
+    gnabar	= 3.0	(mho/cm2)
+    gkbar   = 0.08 	(mho/cm2)
+    gl	= 0.007 (mho/cm2)
+    ena     = 50.0  (mV)
+    ek      = -90.0 (mV)
+    el	= -90.0 (mV)
+    celsius		(degC)
+    dt              (ms)
+    v               (mV)
+    vtraub=-80
+    ampA = 0.01
+    ampB = 27
+    ampC = 10.2
+    bmpA = 0.00025
+    bmpB = 34
+    bmpC = 10
+    amA = 1.86
+    amB = 21.4
+    amC = 10.3
+    bmA = 0.086
+    bmB = 25.7
+    bmC = 9.16
+    ahA = 0.062
+    ahB = 114.0
+    ahC = 11.0
+    bhA = 2.3
+    bhB = 31.8
+    bhC = 13.4
+    asA = 0.3
+    asB = -27
+    asC = -5
+    bsA = 0.03
+    bsB = 10
+    bsC = -1
 }
 
 STATE {
-	mp m h s
+    mp m h s
 }
 
 ASSIGNED {
-	inap    (mA/cm2)
-	ina	(mA/cm2)
-	ik      (mA/cm2)
-	il      (mA/cm2)
-	mp_inf
-	m_inf
-	h_inf
-	s_inf
-	tau_mp
-	tau_m
-	tau_h
-	tau_s
-	q10_1
-	q10_2
-	q10_3
+    gnap    (mho/cm2)
+    gna     (mho/cm2)
+    gk      (mho/cm2)
+    inap    (mA/cm2)
+    ina	(mA/cm2)
+    ik      (mA/cm2)
+    il      (mA/cm2)
+    mp_inf
+    m_inf
+    h_inf
+    s_inf
+    tau_mp
+    tau_m
+    tau_h
+    tau_s
+    q10_1
+    q10_2
+    q10_3
 }
 
 BREAKPOINT {
-	SOLVE states METHOD cnexp
-	inap = gnapbar * mp*mp*mp * (v - ena)
-	ina = gnabar * m*m*m*h * (v - ena)
-	ik   = gkbar * s * (v - ek)
-	il   = gl * (v - el)
+    SOLVE states METHOD cnexp
+    gnap = gnapbar * mp*mp*mp
+    inap = gnap * (v - ena)
+    gna = gnabar * m*m*m*h
+    ina = gna * (v - ena)
+    gk = gkbar * s
+    ik = gk * (v - ek)
+    il = gl * (v - el)
 }
 
 DERIVATIVE states {   : exact Hodgkin-Huxley equations
-       evaluate_fct(v)
-	mp'= (mp_inf - mp) / tau_mp
-	m' = (m_inf - m) / tau_m
-	h' = (h_inf - h) / tau_h
-	s' = (s_inf - s) / tau_s
+    evaluate_fct(v)
+    mp'= (mp_inf - mp) / tau_mp
+    m' = (m_inf - m) / tau_m
+    h' = (h_inf - h) / tau_h
+    s' = (s_inf - s) / tau_s
 }
 
 UNITSOFF
@@ -116,96 +123,96 @@ INITIAL {
 :	Q10 adjustment
 :
 
-	q10_1 = 2.2 ^ ((celsius-20)/ 10 )
-	q10_2 = 2.9 ^ ((celsius-20)/ 10 )
-	q10_3 = 3.0 ^ ((celsius-36)/ 10 )
+    q10_1 = 2.2 ^ ((celsius-20)/ 10 )
+    q10_2 = 2.9 ^ ((celsius-20)/ 10 )
+    q10_3 = 3.0 ^ ((celsius-36)/ 10 )
 
-	evaluate_fct(v)
-	mp = mp_inf
-	m = m_inf
-	h = h_inf
-	s = s_inf
+    evaluate_fct(v)
+    mp = mp_inf
+    m = m_inf
+    h = h_inf
+    s = s_inf
 }
 
 PROCEDURE evaluate_fct(v(mV)) { LOCAL a,b,v2
 
-	a = q10_1*vtrap1(v)
-	b = q10_1*vtrap2(v)
-	tau_mp = 1 / (a + b)
-	mp_inf = a / (a + b)
+    a = q10_1*vtrap1(v)
+    b = q10_1*vtrap2(v)
+    tau_mp = 1 / (a + b)
+    mp_inf = a / (a + b)
 
-	a = q10_1*vtrap6(v)
-	b = q10_1*vtrap7(v)
-	tau_m = 1 / (a + b)
-	m_inf = a / (a + b)
+    a = q10_1*vtrap6(v)
+    b = q10_1*vtrap7(v)
+    tau_m = 1 / (a + b)
+    m_inf = a / (a + b)
 
-	a = q10_2*vtrap8(v)
-	b = q10_2*bhA / (1 + Exp(-(v+bhB)/bhC))
-	tau_h = 1 / (a + b)
-	h_inf = a / (a + b)
+    a = q10_2*vtrap8(v)
+    b = q10_2*bhA / (1 + Exp(-(v+bhB)/bhC))
+    tau_h = 1 / (a + b)
+    h_inf = a / (a + b)
 
-	v2 = v - vtraub : convert to traub convention
+    v2 = v - vtraub : convert to traub convention
 
-	a = q10_3*asA / (Exp((v2+asB)/asC) + 1) 
-	b = q10_3*bsA / (Exp((v2+bsB)/bsC) + 1)
-	tau_s = 1 / (a + b)
-	s_inf = a / (a + b)
+    a = q10_3*asA / (Exp((v2+asB)/asC) + 1) 
+    b = q10_3*bsA / (Exp((v2+bsB)/bsC) + 1)
+    tau_s = 1 / (a + b)
+    s_inf = a / (a + b)
 }
 
 FUNCTION vtrap(x) {
-	if (x < -50) {
-		vtrap = 0
-	}else{
-		vtrap = bsA / (Exp((x+bsB)/bsC) + 1)
-	}
+    if (x < -50) {
+        vtrap = 0
+    }else{
+        vtrap = bsA / (Exp((x+bsB)/bsC) + 1)
+    }
 }
 
 FUNCTION vtrap1(x) {
-	if (fabs((x+ampB)/ampC) < 1e-6) {
-		vtrap1 = ampA*ampC
-	}else{
-		vtrap1 = (ampA*(x+ampB)) / (1 - Exp(-(x+ampB)/ampC))
-	}
+    if (fabs((x+ampB)/ampC) < 1e-6) {
+        vtrap1 = ampA*ampC
+    }else{
+        vtrap1 = (ampA*(x+ampB)) / (1 - Exp(-(x+ampB)/ampC))
+    }
 }
 
 FUNCTION vtrap2(x) {
-	if (fabs((x+bmpB)/bmpC) < 1e-6) {
-		vtrap2 = bmpA*bmpC : Ted Carnevale minus sign bug fix
-	}else{
-		vtrap2 = (bmpA*(-(x+bmpB))) / (1 - Exp((x+bmpB)/bmpC))
-	}
+    if (fabs((x+bmpB)/bmpC) < 1e-6) {
+        vtrap2 = bmpA*bmpC : Ted Carnevale minus sign bug fix
+    }else{
+        vtrap2 = (bmpA*(-(x+bmpB))) / (1 - Exp((x+bmpB)/bmpC))
+    }
 }
 
 FUNCTION vtrap6(x) {
-	if (fabs((x+amB)/amC) < 1e-6) {
-		vtrap6 = amA*amC
-	}else{
-		vtrap6 = (amA*(x+amB)) / (1 - Exp(-(x+amB)/amC))
-	}
+    if (fabs((x+amB)/amC) < 1e-6) {
+        vtrap6 = amA*amC
+    }else{
+        vtrap6 = (amA*(x+amB)) / (1 - Exp(-(x+amB)/amC))
+    }
 }
 
 FUNCTION vtrap7(x) {
-	if (fabs((x+bmB)/bmC) < 1e-6) {
-		vtrap7 = bmA*bmC : Ted Carnevale minus sign bug fix
-	}else{
-		vtrap7 = (bmA*(-(x+bmB))) / (1 - Exp((x+bmB)/bmC))
-	}
+    if (fabs((x+bmB)/bmC) < 1e-6) {
+        vtrap7 = bmA*bmC : Ted Carnevale minus sign bug fix
+    }else{
+        vtrap7 = (bmA*(-(x+bmB))) / (1 - Exp((x+bmB)/bmC))
+    }
 }
 
 FUNCTION vtrap8(x) {
-	if (fabs((x+ahB)/ahC) < 1e-6) {
-		vtrap8 = ahA*ahC : Ted Carnevale minus sign bug fix
-	}else{
-		vtrap8 = (ahA*(-(x+ahB))) / (1 - Exp((x+ahB)/ahC)) 
-	}
+    if (fabs((x+ahB)/ahC) < 1e-6) {
+        vtrap8 = ahA*ahC : Ted Carnevale minus sign bug fix
+    }else{
+        vtrap8 = (ahA*(-(x+ahB))) / (1 - Exp((x+ahB)/ahC)) 
+    }
 }
 
 FUNCTION Exp(x) {
-	if (x < -100) {
-		Exp = 0
-	}else{
-		Exp = exp(x)
-	}
+    if (x < -100) {
+        Exp = 0
+    }else{
+        Exp = exp(x)
+    }
 }
 
 UNITSON
\ No newline at end of file
diff --git a/nrv/_misc/mods/DNav18.mod b/nrv/_misc/mods/DNav18.mod
index 2bc46db0..c74c0c38 100644
--- a/nrv/_misc/mods/DNav18.mod
+++ b/nrv/_misc/mods/DNav18.mod
@@ -6,7 +6,7 @@
 NEURON {
 	SUFFIX nav1p8
 	USEION na READ ena WRITE ina
- 	RANGE gbar, ena, ina, celsiusT
+ 	RANGE gbar, ena, ina, celsiusT, g
 }
 
 UNITS {
diff --git a/nrv/_misc/mods/can.mod b/nrv/_misc/mods/can.mod
index 81f75485..8556f819 100644
--- a/nrv/_misc/mods/can.mod
+++ b/nrv/_misc/mods/can.mod
@@ -6,7 +6,7 @@
 	NEURON {
 		   SUFFIX can							:Sets suffix of mechanism for insertion into models
 		   USEION ca READ cao, cai WRITE ica	:Lays out which NEURON variables will be used/modified by file
-		   RANGE gbar, ecan, ica, shiftcan		:Allows variables to be modified in hoc and collected in vectors
+		   RANGE gbar, ecan, ica, shiftcan, g	:Allows variables to be modified in hoc and collected in vectors
 
 	}
 
diff --git a/nrv/_misc/mods/cat.mod b/nrv/_misc/mods/cat.mod
index e423b3ef..80dbffc6 100644
--- a/nrv/_misc/mods/cat.mod
+++ b/nrv/_misc/mods/cat.mod
@@ -6,7 +6,7 @@
 	NEURON {
 		   SUFFIX cat							:Sets suffix of mechanism for insertion into models
 		   USEION ca READ cai, cao WRITE ica	:Lays out which NEURON variables will be used/modified by file
-		   RANGE gbar, ecat, ica, shiftcat		:Allows variables to be modified in hoc and collected in vectors
+		   RANGE gbar, ecat, ica, shiftcat, g	:Allows variables to be modified in hoc and collected in vectors
 
 	}
 
diff --git a/nrv/_misc/mods/flut_motor.mod b/nrv/_misc/mods/flut_motor.mod
index c040b2c9..0cc35c1f 100644
--- a/nrv/_misc/mods/flut_motor.mod
+++ b/nrv/_misc/mods/flut_motor.mod
@@ -31,103 +31,110 @@ TITLE Motor Axon Flut channels
 INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
 
 NEURON {
-	SUFFIX flut_motor
-	NONSPECIFIC_CURRENT ik
-	NONSPECIFIC_CURRENT il
-	NONSPECIFIC_CURRENT iq
-	NONSPECIFIC_CURRENT ikf
-	RANGE gkbar, gl, gq, gkf, ek, el, eq, ekf
-	RANGE s_inf, q_inf, n_inf
-	RANGE tau_s, tau_q, tau_n
+    SUFFIX flut_motor
+    NONSPECIFIC_CURRENT ik
+    NONSPECIFIC_CURRENT il
+    NONSPECIFIC_CURRENT iq
+    NONSPECIFIC_CURRENT ikf
+    RANGE gkbar, gl, gqbar, gkfbar, ek, el, eq, ekf
+    RANGE gk, gq, gkf
+    RANGE s_inf, q_inf, n_inf
+    RANGE tau_s, tau_q, tau_n
 }
 
 
 UNITS {
-	(mA) = (milliamp)
-	(mV) = (millivolt)
+    (mA) = (milliamp)
+    (mV) = (millivolt)
 
 }
 
 PARAMETER {
 
     : conductance values
-	gkbar   = 0.002581 (mho/cm2)
-	gl	= 0.0002 (mho/cm2)
-	gq	= 0.002232 (mho/cm2)
-	gkf	= 0.02568 (mho/cm2)
+    gkbar   = 0.002581 (mho/cm2)
+    gl	= 0.0002 (mho/cm2)
+    gqbar	= 0.002232 (mho/cm2)
+    gkfbar	= 0.02568 (mho/cm2)
 
     : reversal potentials
-	ek      = -90.0 (mV)
-	el	= -90.0 (mV)
-	eq	= -54.9 (mV)
-	ekf	= -90.0 (mV)
+    ek      = -90.0 (mV)
+    el	= -90.0 (mV)
+    eq	= -54.9 (mV)
+    ekf	= -90.0 (mV)
 
     : read in from .hoc file
-	celsius		(degC)
-	dt              (ms)
-	v               (mV)
-	vtraub=-80	(mV)
+    celsius		(degC)
+    dt              (ms)
+    v               (mV)
+    vtraub=-80	(mV)
 
     : parameters determining rate constants
 
     : slow K+
-	asA = 0.3	(1000/sec)
-	asB = -27	(mV)
-	asC = -5	(mV)
-	bsA = 0.03	(1000/sec)
-	bsB = 10	(mV)
-	bsC = -1	(mV)
+    asA = 0.3	(1000/sec)
+    asB = -27	(mV)
+    asC = -5	(mV)
+    bsA = 0.03	(1000/sec)
+    bsB = 10	(mV)
+    bsC = -1	(mV)
 
     : HCN
-	aqA = .00522	(1000/sec)
-	aqB = -107.3	(mV)
-	aqC = -12.2	(mV)
-	bqA = .00522	(1000/sec)
-	bqB = -107.3	(mV)
-	bqC = -12.2	(mV)
+    aqA = .00522	(1000/sec)
+    aqB = -107.3	(mV)
+    aqC = -12.2	(mV)
+    bqA = .00522	(1000/sec)
+    bqB = -107.3	(mV)
+    bqC = -12.2	(mV)
 
     : fast K+
-	anA = 0.0462	(1000/sec)
-	anB = -83.2	(mV)
-	anC = 1.1	(mV)
-	bnA = 0.0824	(1000/sec)
-	bnB = -66	(mV)
-	bnC = 10.5	(mV)
+    anA = 0.0462	(1000/sec)
+    anB = -83.2	(mV)
+    anC = 1.1	(mV)
+    bnA = 0.0824	(1000/sec)
+    bnB = -66	(mV)
+    bnC = 10.5	(mV)
 }
 
 STATE {
-	s q n
+    s q n
 }
 
 ASSIGNED {
-	ik      (mA/cm2)
-	il      (mA/cm2)
-	iq	(mA/cm2)
-	ikf	(mA/cm2)
-	s_inf	
-	q_inf
-	n_inf
-	tau_s	(ms)
-	tau_q	(ms)
-	tau_n	(ms)
-	q10_1
-	q10_2
-	q10_3
+    gk      (mho/cm2)
+    gq      (mho/cm2)
+    gkf     (mho/cm2)
+    ik      (mA/cm2)
+    il      (mA/cm2)
+    iq	(mA/cm2)
+    ikf	(mA/cm2)
+    s_inf	
+    q_inf
+    n_inf
+    tau_s	(ms)
+    tau_q	(ms)
+    tau_n	(ms)
+    q10_1
+    q10_2
+    q10_3
 }
 
 BREAKPOINT {
-	SOLVE states METHOD cnexp
-	ik   = gkbar * s * (v - ek)
-	il   = gl * (v - el)
-	iq = gq * q * (v-eq)
-	ikf = gkf * n*n*n*n* (v-ekf)
+    SOLVE states METHOD cnexp
+    gk = gkbar * s
+    ik = gk * (v - ek)
+    il = gl * (v - el)
+    gq = gqbar * q
+    iq = gq * (v - eq)
+    gkf = gkfbar * n*n*n*n
+    ikf = gkf * (v - ekf)
 }
 
 DERIVATIVE states {   : exact Hodgkin-Huxley equations
-       evaluate_fct(v)
-	s' = (s_inf - s) / tau_s
-	q' = (q_inf - q) / tau_q
-	n' = (n_inf - n) / tau_n
+    evaluate_fct(v)
+    s' = (s_inf - s) / tau_s
+    q' = (q_inf - q) / tau_q
+    n' = (n_inf - n) / tau_n
 }
 
 UNITSOFF
@@ -138,37 +145,37 @@ INITIAL {
 :   Temperature dependence
 :
 
-	q10_1 = 2.2 ^ ((celsius-20)/ 10 )
-	q10_2 = 2.9 ^ ((celsius-20)/ 10 )
-	q10_3 = 3.0 ^ ((celsius-36)/ 10 )
+    q10_1 = 2.2 ^ ((celsius-20)/ 10 )
+    q10_2 = 2.9 ^ ((celsius-20)/ 10 )
+    q10_3 = 3.0 ^ ((celsius-36)/ 10 )
 
-	evaluate_fct(v)
-	s = s_inf
-	q = q_inf
-	n = n_inf
+    evaluate_fct(v)
+    s = s_inf
+    q = q_inf
+    n = n_inf
 }
 
 PROCEDURE evaluate_fct(v(mV)) { LOCAL a,b,v2
 
-	v2 = v - vtraub : convert to traub convention
+    v2 = v - vtraub : convert to traub convention
 
     : slow K+
-	a = q10_3*asA / (Exp((v2+asB)/asC) + 1) 
-	b = q10_3*bsA / (Exp((v2+bsB)/bsC) + 1)
-	tau_s = 1 / (a + b)
-	s_inf = a / (a + b)
+    a = q10_3*asA / (Exp((v2+asB)/asC) + 1) 
+    b = q10_3*bsA / (Exp((v2+bsB)/bsC) + 1)
+    tau_s = 1 / (a + b)
+    s_inf = a / (a + b)
 
     : HCN
-	a = q10_3*aqA * (Exp((v-aqB)/aqC)) 
-	b = q10_3*bqA / (Exp((v-bqB)/bqC))
-	tau_q = 1 / (a + b)
-	q_inf = a / (a + b)
+    a = q10_3*aqA * (Exp((v-aqB)/aqC)) 
+    b = q10_3*bqA / (Exp((v-bqB)/bqC))
+    tau_q = 1 / (a + b)
+    q_inf = a / (a + b)
 
     : fast K+
-	a = q10_3*vtrapNA(v)
-	b = q10_3*vtrapNB(v)
-	tau_n = 1 / (a + b)
-	n_inf = a / (a + b)
+    a = q10_3*vtrapNA(v)
+    b = q10_3*vtrapNB(v)
+    tau_n = 1 / (a + b)
+    n_inf = a / (a + b)
 }
 
 : vtrap functions to prevent discontinuity
@@ -189,11 +196,11 @@ FUNCTION vtrapNB(x){
 }
 
 FUNCTION Exp(x) {
-	if (x < -100) {
-		Exp = 0
-	}else{
-		Exp = exp(x)
-	}
+    if (x < -100) {
+        Exp = 0
+    }else{
+        Exp = exp(x)
+    }
 }
 
 UNITSON
\ No newline at end of file
diff --git a/nrv/_misc/mods/flut_sensory.mod b/nrv/_misc/mods/flut_sensory.mod
index 93222971..4b64ee5c 100644
--- a/nrv/_misc/mods/flut_sensory.mod
+++ b/nrv/_misc/mods/flut_sensory.mod
@@ -31,102 +31,109 @@ TITLE Sensory Axon Flut channels
 INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
 
 NEURON {
-	SUFFIX flut_sensory
-	NONSPECIFIC_CURRENT ik
-	NONSPECIFIC_CURRENT il
-	NONSPECIFIC_CURRENT iq
-	NONSPECIFIC_CURRENT ikf
-	RANGE gkbar, gl, gq, gkf, ek, el, eq, ekf
-	RANGE s_inf, q_inf, n_inf
-	RANGE tau_s, tau_q, tau_n
+    SUFFIX flut_sensory
+    NONSPECIFIC_CURRENT ik
+    NONSPECIFIC_CURRENT il
+    NONSPECIFIC_CURRENT iq
+    NONSPECIFIC_CURRENT ikf
+    RANGE gkbar, gl, gqbar, gkfbar, ek, el, eq, ekf
+    RANGE gk, gq, gkf
+    RANGE s_inf, q_inf, n_inf
+    RANGE tau_s, tau_q, tau_n
 }
 
 
 UNITS {
-	(mA) = (milliamp)
-	(mV) = (millivolt)
+    (mA) = (milliamp)
+    (mV) = (millivolt)
 }
 
 PARAMETER {
 
     : channel conductances
-	gkbar   = 0.001324 (mho/cm2)
-	gl	= 0.0001716 (mho/cm2)
-	gq	= 0.003102 (mho/cm2)
-	gkf	= 0.02737 (mho/cm2)
+    gkbar   = 0.001324 (mho/cm2)
+    gl	= 0.0001716 (mho/cm2)
+    gqbar	= 0.003102 (mho/cm2)
+    gkfbar	= 0.02737 (mho/cm2)
 
     : reversal potentials
-	ek      = -90.0 (mV)
-	el	= -90.0 (mV)
-	eq	= -54.9 (mV)
-	ekf	= -90.0 (mV)
+    ek      = -90.0 (mV)
+    el	= -90.0 (mV)
+    eq	= -54.9 (mV)
+    ekf	= -90.0 (mV)
 
     : read in from .hoc file
-	celsius		(degC)
-	dt              (ms)
-	v               (mV)
-	vtraub=-80
+    celsius		(degC)
+    dt              (ms)
+    v               (mV)
+    vtraub=-80
 
     : parameters determining rate constants
 
     : slow K+
-	asA = 0.3
-	asB = -27
-	asC = -5
-	bsA = 0.03
-	bsB = 10
-	bsC = -1
+    asA = 0.3
+    asB = -27
+    asC = -5
+    bsA = 0.03
+    bsB = 10
+    bsC = -1
 
     : HCN
-	aqA = .00522
-	aqB = -94.2
-	aqC = -12.2
-	bqA = .00522
-	bqB = -94.2
-	bqC = -12.2
+    aqA = .00522
+    aqB = -94.2
+    aqC = -12.2
+    bqA = .00522
+    bqB = -94.2
+    bqC = -12.2
 
     : fast K+
-	anA = 0.0462
-	anB = -83.2
-	anC = 1.1
-	bnA = 0.0824
-	bnB = -66
-	bnC = 10.5
+    anA = 0.0462
+    anB = -83.2
+    anC = 1.1
+    bnA = 0.0824
+    bnB = -66
+    bnC = 10.5
 }
 
 STATE {
-	s q n
+    s q n
 }
 
 ASSIGNED {
-	ik      (mA/cm2)
-	il      (mA/cm2)
-	iq	(mA/cm2)
-	ikf	(mA/cm2)
-	s_inf
-	q_inf
-	n_inf
-	tau_s
-	tau_q
-	tau_n
-	q10_1
-	q10_2
-	q10_3
+    gk      (mho/cm2)
+    gq      (mho/cm2)
+    gkf     (mho/cm2)
+    ik      (mA/cm2)
+    il      (mA/cm2)
+    iq	(mA/cm2)
+    ikf	(mA/cm2)
+    s_inf
+    q_inf
+    n_inf
+    tau_s
+    tau_q
+    tau_n
+    q10_1
+    q10_2
+    q10_3
 }
 
 BREAKPOINT {
-	SOLVE states METHOD cnexp
-	ik   = gkbar * s * (v - ek)
-	il   = gl * (v - el)
-	iq = gq * q * (v-eq)
-	ikf = gkf * n*n*n*n* (v-ekf)
+    SOLVE states METHOD cnexp
+    gk = gkbar * s
+    ik = gk * (v - ek)
+    il = gl * (v - el)
+    gq = gqbar * q
+    iq = gq * (v - eq)
+    gkf = gkfbar * n*n*n*n
+    ikf = gkf * (v - ekf)
 }
 
 DERIVATIVE states {   : exact Hodgkin-Huxley equations
-       evaluate_fct(v)
-	s' = (s_inf - s) / tau_s
-	q' = (q_inf - q) / tau_q
-	n' = (n_inf - n) / tau_n
+    evaluate_fct(v)
+    s' = (s_inf - s) / tau_s
+    q' = (q_inf - q) / tau_q
+    n' = (n_inf - n) / tau_n
 }
 
 UNITSOFF
@@ -137,37 +144,37 @@ INITIAL {
 :   Temperature dependence
 :
 
-	q10_1 = 2.2 ^ ((celsius-20)/ 10 )
-	q10_2 = 2.9 ^ ((celsius-20)/ 10 )
-	q10_3 = 3.0 ^ ((celsius-36)/ 10 )
+    q10_1 = 2.2 ^ ((celsius-20)/ 10 )
+    q10_2 = 2.9 ^ ((celsius-20)/ 10 )
+    q10_3 = 3.0 ^ ((celsius-36)/ 10 )
 
-	evaluate_fct(v)
-	s = s_inf
-	q = q_inf
-	n = n_inf
+    evaluate_fct(v)
+    s = s_inf
+    q = q_inf
+    n = n_inf
 }
 
 PROCEDURE evaluate_fct(v(mV)) { LOCAL a,b,v2
 
-	v2 = v - vtraub : convert to traub convention
+    v2 = v - vtraub : convert to traub convention
 
     : slow K+
-	a = q10_3*asA / (Exp((v2+asB)/asC) + 1) 
-	b = q10_3*bsA / (Exp((v2+bsB)/bsC) + 1)
-	tau_s = 1 / (a + b)
-	s_inf = a / (a + b)
+    a = q10_3*asA / (Exp((v2+asB)/asC) + 1) 
+    b = q10_3*bsA / (Exp((v2+bsB)/bsC) + 1)
+    tau_s = 1 / (a + b)
+    s_inf = a / (a + b)
 
     : HCN
-	a = q10_3*aqA * (Exp((v-aqB)/aqC)) 
-	b = q10_3*bqA / (Exp((v-bqB)/bqC))
-	tau_q = 1 / (a + b)
-	q_inf = a / (a + b)
+    a = q10_3*aqA * (Exp((v-aqB)/aqC)) 
+    b = q10_3*bqA / (Exp((v-bqB)/bqC))
+    tau_q = 1 / (a + b)
+    q_inf = a / (a + b)
 
     : fast K+
-	a = q10_3*vtrapNA(v) 
-	b = q10_3*vtrapNB(v)
-	tau_n = 1 / (a + b)
-	n_inf = a / (a + b)
+    a = q10_3*vtrapNA(v) 
+    b = q10_3*vtrapNB(v)
+    tau_n = 1 / (a + b)
+    n_inf = a / (a + b)
 }
 
 : vtrap functions to prevent discontinuity
@@ -188,11 +195,11 @@ FUNCTION vtrapNB(x){
 }
 
 FUNCTION Exp(x) {
-	if (x < -100) {
-		Exp = 0
-	}else{
-		Exp = exp(x)
-	}
+    if (x < -100) {
+        Exp = 0
+    }else{
+        Exp = exp(x)
+    }
 }
 
 UNITSON
\ No newline at end of file
diff --git a/nrv/_misc/mods/h.mod b/nrv/_misc/mods/h.mod
index 0881f790..bdcbbbbc 100644
--- a/nrv/_misc/mods/h.mod
+++ b/nrv/_misc/mods/h.mod
@@ -6,7 +6,7 @@ NEURON {
 	SUFFIX h
 	USEION k READ ek, ko, ki WRITE ik
         USEION na READ ena, nao, nai WRITE ina
-	RANGE gbar, ena, ik, ina, ek, ekna, celsiusT
+	RANGE gbar, ena, ik, ina, ek, ekna, celsiusT, g
 }
 
 UNITS {
diff --git a/nrv/_misc/mods/ka.mod b/nrv/_misc/mods/ka.mod
index 6194637a..0abcd2fe 100644
--- a/nrv/_misc/mods/ka.mod
+++ b/nrv/_misc/mods/ka.mod
@@ -6,7 +6,7 @@
 NEURON {
        SUFFIX ka						:Sets suffix of mechanism for insertion into models
        USEION k READ ek WRITE ik		:Lays out which NEURON variables will be used/modified by file
-       RANGE gbar, ek, ik, shiftka		:Allows variables to be modified in hoc and collected in vectors
+       RANGE gbar, ek, ik, shiftka, g	:Allows variables to be modified in hoc and collected in vectors
 
 }
 : Defines Units different from NEURON base units
diff --git a/nrv/_misc/mods/kd.mod b/nrv/_misc/mods/kd.mod
index bbc03c2e..9efb49dc 100644
--- a/nrv/_misc/mods/kd.mod
+++ b/nrv/_misc/mods/kd.mod
@@ -6,7 +6,7 @@
 	NEURON {
 		   SUFFIX kd								:Sets suffix of mechanism for insertion into models
 		   USEION k READ ek WRITE ik				:Lays out which NEURON variables will be used/modified by file
-		   RANGE gbar, ek, ik, A_betan, shiftkd		:Allows variables to be modified in hoc and collected in vectors
+		   RANGE gbar, ek, ik, A_betan, shiftkd, g	:Allows variables to be modified in hoc and collected in vectors
 
 	}
 
diff --git a/nrv/_misc/mods/kdr_Tiger.mod b/nrv/_misc/mods/kdr_Tiger.mod
index 299ee073..48125eee 100644
--- a/nrv/_misc/mods/kdr_Tiger.mod
+++ b/nrv/_misc/mods/kdr_Tiger.mod
@@ -5,7 +5,7 @@
 NEURON {
 	SUFFIX kdrTiger
 	USEION k READ ek WRITE ik
-	RANGE gbar, ena, ik,ek, celsiusT
+	RANGE gbar, ena, ik,ek, celsiusT, g
 }
 
 UNITS {
diff --git a/nrv/_misc/mods/kds.mod b/nrv/_misc/mods/kds.mod
index 5dce9511..6bdcc59b 100644
--- a/nrv/_misc/mods/kds.mod
+++ b/nrv/_misc/mods/kds.mod
@@ -6,7 +6,7 @@
 	NEURON {
 		   SUFFIX kds						:Sets suffix of mechanism for insertion into models
 		   USEION k READ ek WRITE ik		:Lays out which NEURON variables will be used/modified by file
-		   RANGE gbar, ek, ik, shiftkds		:Allows variables to be modified in hoc and collected in vectors
+		   RANGE gbar, ek, ik, shiftkds, g	:Allows variables to be modified in hoc and collected in vectors
 
 	}
 
diff --git a/nrv/_misc/mods/kf.mod b/nrv/_misc/mods/kf.mod
index 25ae29e3..c1b21e76 100644
--- a/nrv/_misc/mods/kf.mod
+++ b/nrv/_misc/mods/kf.mod
@@ -6,7 +6,7 @@
 NEURON {
 	SUFFIX kf
 	USEION k READ ek WRITE ik
-	RANGE gbar, ek, ik
+	RANGE gbar, ek, ik, g
 	RANGE tau_m, minf, hinf,tau_h,m,h, celsiusT
 }
 
diff --git a/nrv/_misc/mods/kna.mod b/nrv/_misc/mods/kna.mod
index d3086dbd..ac394ad4 100644
--- a/nrv/_misc/mods/kna.mod
+++ b/nrv/_misc/mods/kna.mod
@@ -2,18 +2,18 @@
 : Paramaters according to Wang et al. 2003 (based on Bischoff et al. 1998)
 
 NEURON {
-	SUFFIX kna
-	USEION na READ nai
-	USEION k READ ek WRITE ik
-	RANGE gbar, ik
+    SUFFIX kna
+    USEION na READ nai
+    USEION k READ ek WRITE ik
+    RANGE gbar, ik, g
 }
 
 UNITS {
         (molar)	= (1/liter)                     : moles do not appear in units
         (mM)	= (millimolar)             	
-	(mA)	= (milliamp)
-	(mV)	= (millivolt)
-	(S) 	= (siemens)
+    (mA)	= (milliamp)
+    (mV)	= (millivolt)
+    (S) 	= (siemens)
 
 }
 
@@ -22,31 +22,33 @@ PARAMETER {
 :	kout = 5.6 	(mM)
 
 :	gbar = 0  	(S/cm2)
-	EC50 = 38.7  	(mM)
-	pmax = 0.37
-	nH = 3.5
+    EC50 = 38.7  	(mM)
+    pmax = 0.37
+    nH = 3.5
 
 }
 
 ASSIGNED {
-	v (mV)
-	ek (mV)
-	ik (mA/cm2)
-	nai (mM)
-	gbar (S/cm2)
+    v (mV)
+    ek (mV)
+    ik (mA/cm2)
+    g (S/cm2)
+    nai (mM)
+    gbar (S/cm2)
 }
 
 STATE {	w }
 
 
 INITIAL {
-	w = pmax/(1+(EC50/nai)^nH)
-	ik = gbar*w*(v-ek)
+    w = pmax/(1+(EC50/nai)^nH)
+    g = gbar*w
+    ik = g*(v-ek)
 }
 
 BREAKPOINT {
-	w = pmax/(1+(EC50/nai)^nH)
-	ik = gbar*w*(v-ek)
+    w = pmax/(1+(EC50/nai)^nH)
+    ik = gbar*w*(v-ek)
 }
 
 
diff --git a/nrv/_misc/mods/ks.mod b/nrv/_misc/mods/ks.mod
index 6a8cee06..0b0f4c04 100644
--- a/nrv/_misc/mods/ks.mod
+++ b/nrv/_misc/mods/ks.mod
@@ -7,7 +7,7 @@
 NEURON {
 	SUFFIX ks
 	USEION k READ ek WRITE ik
-	RANGE gbar, ena, ik,ek, celsiusT
+	RANGE gbar, ena, ik,ek, celsiusT, g
 }
 
 UNITS {
diff --git a/nrv/_misc/mods/mysa_motor.mod b/nrv/_misc/mods/mysa_motor.mod
index 2f1eef2e..ddfc62e3 100644
--- a/nrv/_misc/mods/mysa_motor.mod
+++ b/nrv/_misc/mods/mysa_motor.mod
@@ -31,102 +31,109 @@ TITLE Motor Axon MYSA channels
 INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
 
 NEURON {
-	SUFFIX mysa_motor
-	NONSPECIFIC_CURRENT ik
-	NONSPECIFIC_CURRENT il
-	NONSPECIFIC_CURRENT iq
-	NONSPECIFIC_CURRENT ikf
-	RANGE gkbar, gl, gq, gkf, ek, el, eq, ekf
-	RANGE s_inf, q_inf, n_inf
-	RANGE tau_s, tau_q, tau_n
+    SUFFIX mysa_motor
+    NONSPECIFIC_CURRENT ik
+    NONSPECIFIC_CURRENT il
+    NONSPECIFIC_CURRENT iq
+    NONSPECIFIC_CURRENT ikf
+    RANGE gkbar, gl, gqbar, gkfbar, ek, el, eq, ekf
+    RANGE gk, gq, gkf
+    RANGE s_inf, q_inf, n_inf
+    RANGE tau_s, tau_q, tau_n
 }
 
 
 UNITS {
-	(mA) = (milliamp)
-	(mV) = (millivolt)
+    (mA) = (milliamp)
+    (mV) = (millivolt)
 }
 
 PARAMETER {
 
     : conductance values
-	gkbar   = 0.002581 (mho/cm2)
-	gl	= 0.002 (mho/cm2)
-	gq	= 0.002232 (mho/cm2)
-	gkf	= 0.15074 (mho/cm2)
+    gkbar   = 0.002581 (mho/cm2)
+    gl	= 0.002 (mho/cm2)
+    gqbar	= 0.002232 (mho/cm2)
+    gkfbar	= 0.15074 (mho/cm2)
 
     : reversal potentials 
-	ek      = -90.0 (mV)
-	el	= -90.0 (mV)
-	eq	= -54.9 (mV)
-	ekf	= -90.0 (mV)
+    ek      = -90.0 (mV)
+    el	= -90.0 (mV)
+    eq	= -54.9 (mV)
+    ekf	= -90.0 (mV)
 
     : read in from .hoc file
-	celsius		(degC)
-	dt              (ms)
-	v               (mV)
-	vtraub=-80
+    celsius		(degC)
+    dt              (ms)
+    v               (mV)
+    vtraub=-80
 
     : parameters determining rate constants
 
     : slow K+
-	asA = 0.3
-	asB = -27
-	asC = -5
-	bsA = 0.03
-	bsB = 10
-	bsC = -1
+    asA = 0.3
+    asB = -27
+    asC = -5
+    bsA = 0.03
+    bsB = 10
+    bsC = -1
 
     : HCN
-	aqA = .00522
-	aqB = -107.3
-	aqC = -12.2
-	bqA = .00522
-	bqB = -107.3
-	bqC = -12.2
+    aqA = .00522
+    aqB = -107.3
+    aqC = -12.2
+    bqA = .00522
+    bqB = -107.3
+    bqC = -12.2
 
     : fast K+
-	anA = 0.0462
-	anB = -83.2
-	anC = 1.1
-	bnA = 0.0824
-	bnB = -66
-	bnC = 10.5
+    anA = 0.0462
+    anB = -83.2
+    anC = 1.1
+    bnA = 0.0824
+    bnB = -66
+    bnC = 10.5
 }
 
 STATE {
-	s q n
+    s q n
 }
 
 ASSIGNED {
-	ik      (mA/cm2)
-	il      (mA/cm2)
-	iq	(mA/cm2)
-	ikf	(mA/cm2)
-	s_inf
-	q_inf
-	n_inf
-	tau_s	(ms)
-	tau_q	(ms)
-	tau_n	(ms)
-	q10_1
-	q10_2
-	q10_3
+    gk      (mho/cm2)
+    gq      (mho/cm2)
+    gkf     (mho/cm2)
+    ik      (mA/cm2)
+    il      (mA/cm2)
+    iq	(mA/cm2)
+    ikf	(mA/cm2)
+    s_inf
+    q_inf
+    n_inf
+    tau_s	(ms)
+    tau_q	(ms)
+    tau_n	(ms)
+    q10_1
+    q10_2
+    q10_3
 }
 
 BREAKPOINT {
-	SOLVE states METHOD cnexp
-	ik   = gkbar * s * (v - ek)
-	il   = gl * (v - el)
-	iq = gq * q * (v-eq)
-	ikf = gkf * n*n*n*n* (v-ekf)
+    SOLVE states METHOD cnexp
+    gk = gkbar * s
+    ik = gk * (v - ek)
+    il = gl * (v - el)
+    gq = gqbar * q
+    iq = gq * (v-eq)
+    gkf = gkfbar * n*n*n*n
+    ikf =gkf * (v-ekf)
 }
 
 DERIVATIVE states {   : exact Hodgkin-Huxley equations
-       evaluate_fct(v)
-	s' = (s_inf - s) / tau_s
-	q' = (q_inf - q) / tau_q
-	n' = (n_inf - n) / tau_n
+    evaluate_fct(v)
+    s' = (s_inf - s) / tau_s
+    q' = (q_inf - q) / tau_q
+    n' = (n_inf - n) / tau_n
 }
 
 UNITSOFF
@@ -137,37 +144,37 @@ INITIAL {
 :   Temperature dependence
 :
 
-	q10_1 = 2.2 ^ ((celsius-20)/ 10 )
-	q10_2 = 2.9 ^ ((celsius-20)/ 10 )
-	q10_3 = 3.0 ^ ((celsius-36)/ 10 )
+    q10_1 = 2.2 ^ ((celsius-20)/ 10 )
+    q10_2 = 2.9 ^ ((celsius-20)/ 10 )
+    q10_3 = 3.0 ^ ((celsius-36)/ 10 )
 
-	evaluate_fct(v)
-	s = s_inf
-	q = q_inf
-	n = n_inf
+    evaluate_fct(v)
+    s = s_inf
+    q = q_inf
+    n = n_inf
 }
 
 PROCEDURE evaluate_fct(v(mV)) { LOCAL a,b,v2
 
-	v2 = v - vtraub : convert to traub convention
+    v2 = v - vtraub : convert to traub convention
 
     : slow K+
-	a = q10_3*asA / (Exp((v2+asB)/asC) + 1) 
-	b = q10_3*bsA / (Exp((v2+bsB)/bsC) + 1)
-	tau_s = 1 / (a + b)
-	s_inf = a / (a + b)
+    a = q10_3*asA / (Exp((v2+asB)/asC) + 1) 
+    b = q10_3*bsA / (Exp((v2+bsB)/bsC) + 1)
+    tau_s = 1 / (a + b)
+    s_inf = a / (a + b)
 
     : HCN
-	a = q10_3*aqA * (Exp((v-aqB)/aqC)) 
-	b = q10_3*bqA / (Exp((v-bqB)/bqC))
-	tau_q = 1 / (a + b)
-	q_inf = a / (a + b)
+    a = q10_3*aqA * (Exp((v-aqB)/aqC)) 
+    b = q10_3*bqA / (Exp((v-bqB)/bqC))
+    tau_q = 1 / (a + b)
+    q_inf = a / (a + b)
 
     : fast K+
-	a = q10_3*vtrapNA(v)
-	b = q10_3*vtrapNB(v)
-	tau_n = 1 / (a + b)
-	n_inf = a / (a + b)
+    a = q10_3*vtrapNA(v)
+    b = q10_3*vtrapNB(v)
+    tau_n = 1 / (a + b)
+    n_inf = a / (a + b)
 }
 
 : vtrap functions to prevent discontinuity
@@ -188,11 +195,11 @@ FUNCTION vtrapNB(x){
 }
 
 FUNCTION Exp(x) {
-	if (x < -100) {
-		Exp = 0
-	}else{
-		Exp = exp(x)
-	}
+    if (x < -100) {
+        Exp = 0
+    }else{
+        Exp = exp(x)
+    }
 }
 
 UNITSON
\ No newline at end of file
diff --git a/nrv/_misc/mods/mysa_sensory.mod b/nrv/_misc/mods/mysa_sensory.mod
index 3d3e1d66..3ffffc74 100644
--- a/nrv/_misc/mods/mysa_sensory.mod
+++ b/nrv/_misc/mods/mysa_sensory.mod
@@ -31,102 +31,109 @@ TITLE Motor Axon MYSA channels
 INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
 
 NEURON {
-	SUFFIX mysa_sensory
-	NONSPECIFIC_CURRENT ik
-	NONSPECIFIC_CURRENT il
-	NONSPECIFIC_CURRENT iq
-	NONSPECIFIC_CURRENT ikf
-	RANGE gkbar, gl, gq, gkf, ek, el, eq, ekf
-	RANGE s_inf, q_inf, n_inf
-	RANGE tau_s, tau_q, tau_n
+    SUFFIX mysa_sensory
+    NONSPECIFIC_CURRENT ik
+    NONSPECIFIC_CURRENT il
+    NONSPECIFIC_CURRENT iq
+    NONSPECIFIC_CURRENT ikf
+    RANGE gkbar, gl, gqbar, gkfbar, ek, el, eq, ekf
+    RANGE gk, gq, gkf
+    RANGE s_inf, q_inf, n_inf
+    RANGE tau_s, tau_q, tau_n
 }
 
 
 UNITS {
-	(mA) = (milliamp)
-	(mV) = (millivolt)
+    (mA) = (milliamp)
+    (mV) = (millivolt)
 }
 
 PARAMETER {
 
     : channel conductances
-	gkbar   = 0.001324 (mho/cm2)
-	gl	= 0.001716 (mho/cm2)
-	gq	= 0.003102 (mho/cm2)
-	gkf	= 0.1642 (mho/cm2)
+    gkbar   = 0.001324 (mho/cm2)
+    gl	= 0.001716 (mho/cm2)
+    gqbar	= 0.003102 (mho/cm2)
+    gkfbar	= 0.1642 (mho/cm2)
 
     : reversal potentials
-	ek      = -90.0 (mV)
-	el	= -90.0 (mV)
-	eq	= -54.9 (mV)
-	ekf	= -90.0 (mV)
+    ek      = -90.0 (mV)
+    el	= -90.0 (mV)
+    eq	= -54.9 (mV)
+    ekf	= -90.0 (mV)
 
     : read in from .hoc file
-	celsius		(degC)
-	dt              (ms)
-	v               (mV)
-	vtraub=-80
+    celsius		(degC)
+    dt              (ms)
+    v               (mV)
+    vtraub=-80
 
     : parameters determining rate constants
 
     : slow K+
-	asA = 0.3
-	asB = -27
-	asC = -5
-	bsA = 0.03
-	bsB = 10
-	bsC = -1
+    asA = 0.3
+    asB = -27
+    asC = -5
+    bsA = 0.03
+    bsB = 10
+    bsC = -1
 
     : HCN
-	aqA = .00522
-	aqB = -94.2
-	aqC = -12.2
-	bqA = .00522
-	bqB = -94.2
-	bqC = -12.2
-   
+    aqA = .00522
+    aqB = -94.2
+    aqC = -12.2
+    bqA = .00522
+    bqB = -94.2
+    bqC = -12.2
+
     : fast K+
-	anA = 0.0462
-	anB = -83.2
-	anC = 1.1
-	bnA = 0.0824
-	bnB = -66
-	bnC = 10.5
+    anA = 0.0462
+    anB = -83.2
+    anC = 1.1
+    bnA = 0.0824
+    bnB = -66
+    bnC = 10.5
 }
 
 STATE {
-	s q n
+    s q n
 }
 
 ASSIGNED {
-	ik      (mA/cm2)
-	il      (mA/cm2)
-	iq	(mA/cm2)
-	ikf	(mA/cm2)
-	s_inf
-	q_inf
-	n_inf
-	tau_s
-	tau_q
-	tau_n
-	q10_1
-	q10_2
-	q10_3
+    gk      (mho/cm2)
+    gq      (mho/cm2)
+    gkf     (mho/cm2)
+    ik      (mA/cm2)
+    il      (mA/cm2)
+    iq	(mA/cm2)
+    ikf	(mA/cm2)
+    s_inf
+    q_inf
+    n_inf
+    tau_s
+    tau_q
+    tau_n
+    q10_1
+    q10_2
+    q10_3
 }
 
 BREAKPOINT {
-	SOLVE states METHOD cnexp
-	ik   = gkbar * s * (v - ek)
-	il   = gl * (v - el)
-	iq = gq * q * (v-eq)
-	ikf = gkf * n*n*n*n* (v-ekf)
+    SOLVE states METHOD cnexp
+    gk = gkbar * s
+    ik = gk * (v - ek)
+    il = gl * (v - el)
+    gq = gqbar * q
+    iq = gq * (v - eq)
+    gkf = gkfbar * n*n*n*n
+    ikf = gkf * (v - ekf)
 }
 
 DERIVATIVE states {   : exact Hodgkin-Huxley equations
-       evaluate_fct(v)
-	s' = (s_inf - s) / tau_s
-	q' = (q_inf - q) / tau_q
-	n' = (n_inf - n) / tau_n
+    evaluate_fct(v)
+    s' = (s_inf - s) / tau_s
+    q' = (q_inf - q) / tau_q
+    n' = (n_inf - n) / tau_n
 }
 
 UNITSOFF
@@ -137,37 +144,37 @@ INITIAL {
 :   Temperature dependence
 :
 
-	q10_1 = 2.2 ^ ((celsius-20)/ 10 )
-	q10_2 = 2.9 ^ ((celsius-20)/ 10 )
-	q10_3 = 3.0 ^ ((celsius-36)/ 10 )
+    q10_1 = 2.2 ^ ((celsius-20)/ 10 )
+    q10_2 = 2.9 ^ ((celsius-20)/ 10 )
+    q10_3 = 3.0 ^ ((celsius-36)/ 10 )
 
-	evaluate_fct(v)
-	s = s_inf
-	q = q_inf
-	n = n_inf
+    evaluate_fct(v)
+    s = s_inf
+    q = q_inf
+    n = n_inf
 }
 
 PROCEDURE evaluate_fct(v(mV)) { LOCAL a,b,v2
 
-	v2 = v - vtraub : convert to traub convention
+    v2 = v - vtraub : convert to traub convention
 
     : slow K+
-	a = q10_3*asA / (Exp((v2+asB)/asC) + 1) 
-	b = q10_3*bsA / (Exp((v2+bsB)/bsC) + 1)
-	tau_s = 1 / (a + b)
-	s_inf = a / (a + b)
+    a = q10_3*asA / (Exp((v2+asB)/asC) + 1) 
+    b = q10_3*bsA / (Exp((v2+bsB)/bsC) + 1)
+    tau_s = 1 / (a + b)
+    s_inf = a / (a + b)
 
     : HCN
-	a = q10_3*aqA * (Exp((v-aqB)/aqC)) 
-	b = q10_3*bqA / (Exp((v-bqB)/bqC))
-	tau_q = 1 / (a + b)
-	q_inf = a / (a + b)
+    a = q10_3*aqA * (Exp((v-aqB)/aqC)) 
+    b = q10_3*bqA / (Exp((v-bqB)/bqC))
+    tau_q = 1 / (a + b)
+    q_inf = a / (a + b)
 
     : fast K+
-	a = q10_3*vtrapNA(v)
-	b = q10_3*vtrapNB(v)
-	tau_n = 1 / (a + b)
-	n_inf = a / (a + b)
+    a = q10_3*vtrapNA(v)
+    b = q10_3*vtrapNB(v)
+    tau_n = 1 / (a + b)
+    n_inf = a / (a + b)
 }
 
 : vtrap functions to prevent discontinuity
@@ -188,11 +195,11 @@ FUNCTION vtrapNB(x){
 }
 
 FUNCTION Exp(x) {
-	if (x < -100) {
-		Exp = 0
-	}else{
-		Exp = exp(x)
-	}
+    if (x < -100) {
+        Exp = 0
+    }else{
+        Exp = exp(x)
+    }
 }
 
 UNITSON
\ No newline at end of file
diff --git a/nrv/_misc/mods/naf.mod b/nrv/_misc/mods/naf.mod
index 0a9ae67e..f0eeff8c 100644
--- a/nrv/_misc/mods/naf.mod
+++ b/nrv/_misc/mods/naf.mod
@@ -4,9 +4,9 @@
 
 : Neuron Block creates mechanism
 	NEURON {
-		   SUFFIX naf						:Sets suffix of mechanism for insertion into models
-		   USEION na READ ena WRITE ina		:Lays out which NEURON variables will be used/modified by file
-		   RANGE gbar, ena, ina, shiftnaf	:Allows variables to be modified in hoc and collected in vectors
+		   SUFFIX naf							:Sets suffix of mechanism for insertion into models
+		   USEION na READ ena WRITE ina			:Lays out which NEURON variables will be used/modified by file
+		   RANGE gbar, ena, ina, shiftnaf, g	:Allows variables to be modified in hoc and collected in vectors
 
 	}
 
diff --git a/nrv/_misc/mods/naf97.mod b/nrv/_misc/mods/naf97.mod
index 34a6bbef..57465c60 100644
--- a/nrv/_misc/mods/naf97.mod
+++ b/nrv/_misc/mods/naf97.mod
@@ -4,9 +4,9 @@
 
 : Neuron Block creates mechanism
 	NEURON {
-		   SUFFIX naf97						:Sets suffix of mechanism for insertion into models
-		   USEION na READ ena WRITE ina		:Lays out which NEURON variables will be used/modified by file
-		   RANGE gbar, ena, ina, shiftnaf	:Allows variables to be modified in hoc and collected in vectors
+		   SUFFIX naf97							:Sets suffix of mechanism for insertion into models
+		   USEION na READ ena WRITE ina			:Lays out which NEURON variables will be used/modified by file
+		   RANGE gbar, ena, ina, shiftnaf, g	:Allows variables to be modified in hoc and collected in vectors
 
 	}
 
diff --git a/nrv/_misc/mods/naf97mean.mod b/nrv/_misc/mods/naf97mean.mod
index 40559284..23351682 100644
--- a/nrv/_misc/mods/naf97mean.mod
+++ b/nrv/_misc/mods/naf97mean.mod
@@ -4,9 +4,9 @@
 
 : Neuron Block creates mechanism
 	NEURON {
-		   SUFFIX naf97mean						:Sets suffix of mechanism for insertion into models
-		   USEION na READ ena WRITE ina		:Lays out which NEURON variables will be used/modified by file
-		   RANGE gbar, ena, ina, shiftnaf	:Allows variables to be modified in hoc and collected in vectors
+		   SUFFIX naf97mean							:Sets suffix of mechanism for insertion into models
+		   USEION na READ ena WRITE ina			:Lays out which NEURON variables will be used/modified by file
+		   RANGE gbar, ena, ina, shiftnaf, g	:Allows variables to be modified in hoc and collected in vectors
 
 	}
 
diff --git a/nrv/_misc/mods/nahh.mod b/nrv/_misc/mods/nahh.mod
index c6f5b138..c08a81ea 100644
--- a/nrv/_misc/mods/nahh.mod
+++ b/nrv/_misc/mods/nahh.mod
@@ -3,91 +3,94 @@ TITLE nahh
 : Cummins et al. (2007), Sheets et al. (2007)
 
 NEURON {
-	SUFFIX nahh
-	USEION na READ ena WRITE ina
-	RANGE gnabar, m, h, ishift, mshift, hshift
-	GLOBAL inf,tau
+    SUFFIX nahh
+    USEION na READ ena WRITE ina
+    RANGE gnabar, m, h, ishift, mshift, hshift, gna
+    GLOBAL inf,tau
 }
 
 UNITS {
-	(mA) = (milliamp)
-	(mV) = (millivolt)
+    (mA) = (milliamp)
+    (mV) = (millivolt)
+    (S)  = (siemens)
 }
 
 PARAMETER {
-	v (mV)
-	celsius		(degC)
-	gnabar=.30 	(mho/cm2)
-	ena 		(mV)
-	ishift		(mV)
-	mshift		(mV)
-	hshift		(mV)
+    v (mV)
+    celsius		(degC)
+    gnabar=.30 	(mho/cm2)
+    ena 		(mV)
+    ishift		(mV)
+    mshift		(mV)
+    hshift		(mV)
 }
 STATE {
-	m h
+    m h
 }
 ASSIGNED {
-	ina (mA/cm2)
-	inf[2]
-        tau[2]
+    gna (S/cm2)
+    ina (mA/cm2)
+    inf[2]
+    tau[2]
 }
 
 INITIAL {
-         mhn(v)
-         m=inf[0]
-         h=inf[1]
+        mhn(v)
+        m=inf[0]
+        h=inf[1]
 }
 
 BREAKPOINT {
-	SOLVE states METHOD cnexp
-	ina = gnabar*m*m*m*h*(v - ena)
+    SOLVE states METHOD cnexp
+    gna = gnabar*m*m*m*h
+    ina = gna*(v - ena)
 }
 
 DERIVATIVE states {	
-	mhn(v*1(/mV))
-	m' = (inf[0] - m)/tau[0]
-	h' = (inf[1] - h)/tau[1]
+    mhn(v*1(/mV))
+    m' = (inf[0] - m)/tau[0]
+    h' = (inf[1] - h)/tau[1]
 }
 
 
 FUNCTION alp(v(mV),i) { LOCAL q10 :  order m,h
         v=v+65
-	q10 = 3^((celsius - 30)/10)
-	if (i==0) {
-	        v = v + mshift
-		alp = q10*.32*expM1(13.1-v, 4)
-	}else if (i==1){
-	        v = v + hshift
-		alp = q10*.128*exp((17-v+ishift)/18)
-	}
+    q10 = 3^((celsius - 30)/10)
+    if (i==0) {
+            v = v + mshift
+        alp = q10*.32*expM1(13.1-v, 4)
+    }else if (i==1){
+            v = v + hshift
+        alp = q10*.128*exp((17-v+ishift)/18)
+    }
 }
 
 FUNCTION bet(v,i) { LOCAL q10 : order m,h
         v=v+65
-	q10 = 3^((celsius - 30)/10)
-	if (i==0) {
-	  	v = v + mshift
-		bet = q10*.28*expM1(v-40.1,5)
-	}else if (i==1){
-	        v = v + hshift
-		bet = q10*4/(exp((40.0-v)/5) + 1)
-	}
+    q10 = 3^((celsius - 30)/10)
+    if (i==0) {
+        v = v + mshift
+        bet = q10*.28*expM1(v-40.1,5)
+    }else if (i==1){
+            v = v + hshift
+        bet = q10*4/(exp((40.0-v)/5) + 1)
+    }
 }
 
 FUNCTION expM1(x,y) {
-	if (fabs(x/y) < 1e-6) {
-		expM1 = y*(1 - x/y/2)
-	}else{
-		expM1 = x/(exp(x/y) - 1)
-	}
+    if (fabs(x/y) < 1e-6) {
+        expM1 = y*(1 - x/y/2)
+    }else{
+        expM1 = x/(exp(x/y) - 1)
+    }
 }
 
 PROCEDURE mhn(v) {LOCAL a, b 
-	FROM i=0 TO 1 {
-		a = alp(v,i)  
-		b=bet(v,i)
-		tau[i] = 1/(a + b)
-		inf[i] = a/(a + b)
-	}
+    FROM i=0 TO 1 {
+        a = alp(v,i)  
+        b=bet(v,i)
+        tau[i] = 1/(a + b)
+        inf[i] = a/(a + b)
+    }
 }
 
diff --git a/nrv/_misc/mods/nas.mod b/nrv/_misc/mods/nas.mod
index 32b2ace6..ea221e42 100644
--- a/nrv/_misc/mods/nas.mod
+++ b/nrv/_misc/mods/nas.mod
@@ -4,9 +4,9 @@
 
 : Neuron Block creates mechanism
 	NEURON {
-		   SUFFIX nas						:Sets suffix of mechanism for insertion into models
-		   USEION na READ ena WRITE ina		:Lays out which NEURON variables will be used/modified by file
-		   RANGE gbar, ena, ina, shiftnas	:Allows variables to be modified in hoc and collected in vectors
+		   SUFFIX nas							:Sets suffix of mechanism for insertion into models
+		   USEION na READ ena WRITE ina			:Lays out which NEURON variables will be used/modified by file
+		   RANGE gbar, ena, ina, shiftnas, g	:Allows variables to be modified in hoc and collected in vectors
 
 	}
 
diff --git a/nrv/_misc/mods/nas97.mod b/nrv/_misc/mods/nas97.mod
index 54a9adea..135fdd5c 100644
--- a/nrv/_misc/mods/nas97.mod
+++ b/nrv/_misc/mods/nas97.mod
@@ -4,9 +4,9 @@
 
 : Neuron Block creates mechanism
 	NEURON {
-		   SUFFIX nas97						:Sets suffix of mechanism for insertion into models
-		   USEION na READ ena WRITE ina		:Lays out which NEURON variables will be used/modified by file
-		   RANGE gbar, ena, ina, shiftnas	:Allows variables to be modified in hoc and collected in vectors
+		   SUFFIX nas97							:Sets suffix of mechanism for insertion into models
+		   USEION na READ ena WRITE ina			:Lays out which NEURON variables will be used/modified by file
+		   RANGE gbar, ena, ina, shiftnas, g	:Allows variables to be modified in hoc and collected in vectors
 
 	}
 
diff --git a/nrv/_misc/mods/nas97mean.mod b/nrv/_misc/mods/nas97mean.mod
index 386ce4f6..5b947780 100644
--- a/nrv/_misc/mods/nas97mean.mod
+++ b/nrv/_misc/mods/nas97mean.mod
@@ -5,8 +5,8 @@
 : Neuron Block creates mechanism
 	NEURON {
 		   SUFFIX nas97mean						:Sets suffix of mechanism for insertion into models
-		   USEION na READ ena WRITE ina		:Lays out which NEURON variables will be used/modified by file
-		   RANGE gbar, ena, ina, shiftnas	:Allows variables to be modified in hoc and collected in vectors
+		   USEION na READ ena WRITE ina			:Lays out which NEURON variables will be used/modified by file
+		   RANGE gbar, ena, ina, shiftnas, g	:Allows variables to be modified in hoc and collected in vectors
 
 	}
 
diff --git a/nrv/_misc/mods/nattxs.mod b/nrv/_misc/mods/nattxs.mod
index be64ca16..138860d9 100644
--- a/nrv/_misc/mods/nattxs.mod
+++ b/nrv/_misc/mods/nattxs.mod
@@ -4,7 +4,7 @@
 NEURON {
        SUFFIX nattxs
        USEION na READ ena WRITE ina
-       RANGE gbar, ena, ina, celsiusT, Tshift
+       RANGE gbar, ena, ina, celsiusT, Tshift, g
 
 }
 
diff --git a/nrv/_misc/mods/nav1p9.mod b/nrv/_misc/mods/nav1p9.mod
index 66db7db7..2588a2e8 100644
--- a/nrv/_misc/mods/nav1p9.mod
+++ b/nrv/_misc/mods/nav1p9.mod
@@ -8,7 +8,7 @@ NEURON {
        SUFFIX nav1p9
        :NONSPECIFIC_CURRENT i
        USEION na  READ ena WRITE ina
-       RANGE gbar, ena, slow_inact, m, h, s, gate, ina
+       RANGE gbar, ena, slow_inact, m, h, s, gate, ina, g
        RANGE tau_m, tau_h, tau_s, celsiusT, NGFshift1p9
        : if slow_inact=1 then ultra-slow inactivation is included
 }
diff --git a/nrv/_misc/mods/node_motor.mod b/nrv/_misc/mods/node_motor.mod
index 1459e06a..41b5d6dc 100644
--- a/nrv/_misc/mods/node_motor.mod
+++ b/nrv/_misc/mods/node_motor.mod
@@ -30,126 +30,135 @@ TITLE Motor Axon Node channels
 INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
 
 NEURON {
-	SUFFIX node_motor
-	NONSPECIFIC_CURRENT ina
-	NONSPECIFIC_CURRENT inap
-	NONSPECIFIC_CURRENT ik
-	NONSPECIFIC_CURRENT il
-	NONSPECIFIC_CURRENT ikf
-	RANGE gnapbar, gnabar, gkbar, gl, gkf, ena, ek, el, ekf
-	RANGE mp_inf, m_inf, h_inf, s_inf, n_inf
-	RANGE tau_mp, tau_m, tau_h, tau_s, tau_n
+    SUFFIX node_motor
+    NONSPECIFIC_CURRENT ina
+    NONSPECIFIC_CURRENT inap
+    NONSPECIFIC_CURRENT ik
+    NONSPECIFIC_CURRENT il
+    NONSPECIFIC_CURRENT ikf
+    RANGE gnapbar, gnabar, gkbar, gl, gkfbar, ena, ek, el, ekf
+    RANGE gnap, gna, gk, gkf
+    RANGE mp_inf, m_inf, h_inf, s_inf, n_inf
+    RANGE tau_mp, tau_m, tau_h, tau_s, tau_n
 }
 
 
 UNITS {
-	(mA) = (milliamp)
-	(mV) = (millivolt)
+    (mA) = (milliamp)
+    (mV) = (millivolt)
 }
 
 PARAMETER {
 
     : channel conductances
-	gnapbar = 0.01	(mho/cm2)
-	gnabar	= 3.0	(mho/cm2)
-	gkbar   = 0.08	(mho/cm2)
-	gl	= 0.007 (mho/cm2)
-	gkf	= 0.02568	(mho/cm2)
+    gnapbar = 0.01	(mho/cm2)
+    gnabar	= 3.0	(mho/cm2)
+    gkbar   = 0.08	(mho/cm2)
+    gl	= 0.007 (mho/cm2)
+    gkfbar	= 0.02568	(mho/cm2)
 
     : reversal potentials
-	ena     = 50.0  (mV)
-	ek      = -90.0 (mV)
-	el	= -90.0 (mV)
-	ekf	= -90.0 (mV)
+    ena     = 50.0  (mV)
+    ek      = -90.0 (mV)
+    el	= -90.0 (mV)
+    ekf	= -90.0 (mV)
 
     : variables read in from .hoc file
-	celsius		(degC)
-	dt              (ms)
-	v               (mV)
-	vtraub=-80
+    celsius		(degC)
+    dt              (ms)
+    v               (mV)
+    vtraub=-80
 
     : parameters determining rate constants
 
     : persistent Na+
-	ampA = 0.01
-	ampB = 27
-	ampC = 10.2
-	bmpA = 0.00025
-	bmpB = 34
-	bmpC = 10
+    ampA = 0.01
+    ampB = 27
+    ampC = 10.2
+    bmpA = 0.00025
+    bmpB = 34
+    bmpC = 10
 
     : fast Na+
-	amA = 1.86
-	amB = 20.4
-	amC = 10.3
-	bmA = 0.086
-	bmB = 25.7
-	bmC = 9.16
-	ahA = 0.062
-	ahB = 114.0
-	ahC = 11.0
-	bhA = 2.3
-	bhB = 31.8
-	bhC = 13.4
+    amA = 1.86
+    amB = 20.4
+    amC = 10.3
+    bmA = 0.086
+    bmB = 25.7
+    bmC = 9.16
+    ahA = 0.062
+    ahB = 114.0
+    ahC = 11.0
+    bhA = 2.3
+    bhB = 31.8
+    bhC = 13.4
 
     : slow K+
-	asA = 0.3
-	asB = -27
-	asC = -5
-	bsA = 0.03
-	bsB = 10
-	bsC = -1
+    asA = 0.3
+    asB = -27
+    asC = -5
+    bsA = 0.03
+    bsB = 10
+    bsC = -1
 
     : fast K+
-	anA = 0.0462
-	anB = -83.2
-	anC = 1.1
-	bnA = 0.0824
-	bnB = -66
-	bnC = 10.5
+    anA = 0.0462
+    anB = -83.2
+    anC = 1.1
+    bnA = 0.0824
+    bnB = -66
+    bnC = 10.5
 }
 
 STATE {
-	mp m h s n
+    mp m h s n
 }
 
 ASSIGNED {
-	inap    (mA/cm2)
-	ina	(mA/cm2)
-	ik      (mA/cm2)
-	il      (mA/cm2)
-	ikf	(mA/cm2)
-	mp_inf
-	m_inf
-	h_inf
-	s_inf
-	n_inf
-	tau_mp	(ms)
-	tau_m	(ms)
-	tau_h	(ms)
-	tau_s	(ms)
-	tau_n	(ms)
-	q10_1
-	q10_2
-	q10_3
+    gnap    (mho/cm2)
+    gna     (mho/cm2)
+    gk      (mho/cm2)
+    gkf     (mho/cm2)
+    inap    (mA/cm2)
+    ina	(mA/cm2)
+    ik      (mA/cm2)
+    il      (mA/cm2)
+    ikf	(mA/cm2)
+    mp_inf
+    m_inf
+    h_inf
+    s_inf
+    n_inf
+    tau_mp	(ms)
+    tau_m	(ms)
+    tau_h	(ms)
+    tau_s	(ms)
+    tau_n	(ms)
+    q10_1
+    q10_2
+    q10_3
 }
 
 BREAKPOINT {
-	SOLVE states METHOD cnexp
-	inap = gnapbar * mp*mp*mp * (v - ena)
-	ina = gnabar * m*m*m*h * (v - ena)
-	ik   = gkbar * s * (v - ek)
-	il   = gl * (v - el)
-	ikf = gkf * n*n*n*n* (v-ekf)
+    SOLVE states METHOD cnexp
+    gnap = gnapbar * mp*mp*mp
+    inap = gnap * (v - ena)
+    gna = gnabar * m*m*m*h
+    ina = gna * (v - ena)
+    gk = gkbar * s
+    ik = gk * (v - ek)
+    il = gl * (v - el)
+    gkf = gkfbar * n*n*n*n
+    ikf = gkf * (v-ekf)
 }
 
 DERIVATIVE states {   : exact Hodgkin-Huxley equations
-       evaluate_fct(v)
-	mp'= (mp_inf - mp) / tau_mp
-	m' = (m_inf - m) / tau_m
-	h' = (h_inf - h) / tau_h
-	s' = (s_inf - s) / tau_s
-	n' = (n_inf - n) / tau_n
+    evaluate_fct(v)
+    mp'= (mp_inf - mp) / tau_mp
+    m' = (m_inf - m) / tau_m
+    h' = (h_inf - h) / tau_h
+    s' = (s_inf - s) / tau_s
+    n' = (n_inf - n) / tau_n
 }
 
 UNITSOFF
@@ -160,99 +169,99 @@ INITIAL {
 :   Temperature dependence
 :
 
-	q10_1 = 2.2 ^ ((celsius-20)/ 10 )
-	q10_2 = 2.9 ^ ((celsius-20)/ 10 )
-	q10_3 = 3.0 ^ ((celsius-36)/ 10 )
+    q10_1 = 2.2 ^ ((celsius-20)/ 10 )
+    q10_2 = 2.9 ^ ((celsius-20)/ 10 )
+    q10_3 = 3.0 ^ ((celsius-36)/ 10 )
 
-	evaluate_fct(v)
-	mp = mp_inf
-	m = m_inf
-	h = h_inf
-	s = s_inf
-	n = n_inf
+    evaluate_fct(v)
+    mp = mp_inf
+    m = m_inf
+    h = h_inf
+    s = s_inf
+    n = n_inf
 }
 
 PROCEDURE evaluate_fct(v(mV)) { LOCAL a,b,v2
 
     : persistent Na+
-	a = q10_1*vtrap1(v)
-	b = q10_1*vtrap2(v)
-	tau_mp = 1 / (a + b)
-	mp_inf = a / (a + b)
+    a = q10_1*vtrap1(v)
+    b = q10_1*vtrap2(v)
+    tau_mp = 1 / (a + b)
+    mp_inf = a / (a + b)
 
     : fast Na+
-	a = q10_1*vtrap6(v)
-	b = q10_1*vtrap7(v)
-	tau_m = 1 / (a + b)
-	m_inf = a / (a + b)
+    a = q10_1*vtrap6(v)
+    b = q10_1*vtrap7(v)
+    tau_m = 1 / (a + b)
+    m_inf = a / (a + b)
 
-	a = q10_2*vtrap8(v)
-	b = q10_2*bhA / (1 + Exp(-(v+bhB)/bhC))
-	tau_h = 1 / (a + b)
-	h_inf = a / (a + b)
+    a = q10_2*vtrap8(v)
+    b = q10_2*bhA / (1 + Exp(-(v+bhB)/bhC))
+    tau_h = 1 / (a + b)
+    h_inf = a / (a + b)
 
-	v2 = v - vtraub : convert to traub convention
+    v2 = v - vtraub : convert to traub convention
 
     : slow K+
-	a = q10_3*asA / (Exp((v2+asB)/asC) + 1) 
-	b = q10_3*bsA / (Exp((v2+bsB)/bsC) + 1)
-	tau_s = 1 / (a + b)
-	s_inf = a / (a + b)
+    a = q10_3*asA / (Exp((v2+asB)/asC) + 1) 
+    b = q10_3*bsA / (Exp((v2+bsB)/bsC) + 1)
+    tau_s = 1 / (a + b)
+    s_inf = a / (a + b)
 
     : fast K+
-	a = q10_3*vtrapNA(v) 
-	b = q10_3*vtrapNB(v)
-	tau_n = 1 / (a + b)
-	n_inf = a / (a + b)
+    a = q10_3*vtrapNA(v) 
+    b = q10_3*vtrapNB(v)
+    tau_n = 1 / (a + b)
+    n_inf = a / (a + b)
 }
 
 : vtrap functions to prevent discontinuity
 FUNCTION vtrap(x) {
-	if (x < -50) {
-		vtrap = 0
-	}else{
-		vtrap = bsA / (Exp((x+bsB)/bsC) + 1)
-	}
+    if (x < -50) {
+        vtrap = 0
+    }else{
+        vtrap = bsA / (Exp((x+bsB)/bsC) + 1)
+    }
 }
 
 FUNCTION vtrap1(x) {
-	if (fabs((x+ampB)/ampC) < 1e-6) {
-		vtrap1 = ampA*ampC
-	}else{
-		vtrap1 = (ampA*(x+ampB)) / (1 - Exp(-(x+ampB)/ampC))
-	}
+    if (fabs((x+ampB)/ampC) < 1e-6) {
+        vtrap1 = ampA*ampC
+    }else{
+        vtrap1 = (ampA*(x+ampB)) / (1 - Exp(-(x+ampB)/ampC))
+    }
 }
 
 FUNCTION vtrap2(x) {
-	if (fabs((x+bmpB)/bmpC) < 1e-6) {
-		vtrap2 = bmpA*bmpC : Ted Carnevale minus sign bug fix
-	}else{
-		vtrap2 = (bmpA*(-(x+bmpB))) / (1 - Exp((x+bmpB)/bmpC))
-	}
+    if (fabs((x+bmpB)/bmpC) < 1e-6) {
+        vtrap2 = bmpA*bmpC : Ted Carnevale minus sign bug fix
+    }else{
+        vtrap2 = (bmpA*(-(x+bmpB))) / (1 - Exp((x+bmpB)/bmpC))
+    }
 }
 
 FUNCTION vtrap6(x) {
-	if (fabs((x+amB)/amC) < 1e-6) {
-		vtrap6 = amA*amC
-	}else{
-		vtrap6 = (amA*(x+amB)) / (1 - Exp(-(x+amB)/amC))
-	}
+    if (fabs((x+amB)/amC) < 1e-6) {
+        vtrap6 = amA*amC
+    }else{
+        vtrap6 = (amA*(x+amB)) / (1 - Exp(-(x+amB)/amC))
+    }
 }
 
 FUNCTION vtrap7(x) {
-	if (fabs((x+bmB)/bmC) < 1e-6) {
-		vtrap7 = bmA*bmC : Ted Carnevale minus sign bug fix
-	}else{
-		vtrap7 = (bmA*(-(x+bmB))) / (1 - Exp((x+bmB)/bmC))
-	}
+    if (fabs((x+bmB)/bmC) < 1e-6) {
+        vtrap7 = bmA*bmC : Ted Carnevale minus sign bug fix
+    }else{
+        vtrap7 = (bmA*(-(x+bmB))) / (1 - Exp((x+bmB)/bmC))
+    }
 }
 
 FUNCTION vtrap8(x) {
-	if (fabs((x+ahB)/ahC) < 1e-6) {
-		vtrap8 = ahA*ahC : Ted Carnevale minus sign bug fix
-	}else{
-		vtrap8 = (ahA*(-(x+ahB))) / (1 - Exp((x+ahB)/ahC)) 
-	}
+    if (fabs((x+ahB)/ahC) < 1e-6) {
+        vtrap8 = ahA*ahC : Ted Carnevale minus sign bug fix
+    }else{
+        vtrap8 = (ahA*(-(x+ahB))) / (1 - Exp((x+ahB)/ahC)) 
+    }
 }
 
 FUNCTION vtrapNA(x){
@@ -272,11 +281,11 @@ FUNCTION vtrapNB(x){
 }
 
 FUNCTION Exp(x) {
-	if (x < -100) {
-		Exp = 0
-	}else{
-		Exp = exp(x)
-	}
+    if (x < -100) {
+        Exp = 0
+    }else{
+        Exp = exp(x)
+    }
 }
 
 UNITSON
\ No newline at end of file
diff --git a/nrv/_misc/mods/node_sensory.mod b/nrv/_misc/mods/node_sensory.mod
index c63146fb..231089f6 100644
--- a/nrv/_misc/mods/node_sensory.mod
+++ b/nrv/_misc/mods/node_sensory.mod
@@ -30,126 +30,135 @@ TITLE Sensory Axon Node channels
 INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
 
 NEURON {
-	SUFFIX node_sensory
-	NONSPECIFIC_CURRENT ina
-	NONSPECIFIC_CURRENT inap
-	NONSPECIFIC_CURRENT ik
-	NONSPECIFIC_CURRENT il
-	NONSPECIFIC_CURRENT ikf
-	RANGE gnapbar, gnabar, gkbar, gl, gkf, ena, ek, el, ekf
-	RANGE mp_inf, m_inf, h_inf, s_inf, n_inf
-	RANGE tau_mp, tau_m, tau_h, tau_s, tau_n
+    SUFFIX node_sensory
+    NONSPECIFIC_CURRENT ina
+    NONSPECIFIC_CURRENT inap
+    NONSPECIFIC_CURRENT ik
+    NONSPECIFIC_CURRENT il
+    NONSPECIFIC_CURRENT ikf
+    RANGE gnapbar, gnabar, gkbar, gl, gkfbar, ena, ek, el, ekf
+    RANGE gnap, gna, gk, gkf
+    RANGE mp_inf, m_inf, h_inf, s_inf, n_inf
+    RANGE tau_mp, tau_m, tau_h, tau_s, tau_n
 }
 
 
 UNITS {
-	(mA) = (milliamp)
-	(mV) = (millivolt)
+    (mA) = (milliamp)
+    (mV) = (millivolt)
 }
 
 PARAMETER {
 
     : channel conductances
-	gnapbar = 0.01	(mho/cm2)
-	gnabar	= 3.0	(mho/cm2)
-	gkbar   = 0.04106 	(mho/cm2)
-	gl	= 0.006005 (mho/cm2)
-	gkf	= 0.02737	(mho/cm2)
+    gnapbar = 0.01	(mho/cm2)
+    gnabar	= 3.0	(mho/cm2)
+    gkbar   = 0.04106 	(mho/cm2)
+    gl	= 0.006005 (mho/cm2)
+    gkfbar	= 0.02737	(mho/cm2)
 
     : reversal potentials
-	ena     = 50.0  (mV)
-	ek      = -90.0 (mV)
-	el	= -90.0 (mV)
-	ekf	= -90.0 (mV)
+    ena     = 50.0  (mV)
+    ek      = -90.0 (mV)
+    el	= -90.0 (mV)
+    ekf	= -90.0 (mV)
 
     : variables read in from .hoc file
-	celsius		(degC)
-	dt              (ms)
-	v               (mV)
-	vtraub=-80
+    celsius		(degC)
+    dt              (ms)
+    v               (mV)
+    vtraub=-80
 
     : parameters determining rate constants
 
     : persistent Na+
-	ampA = 0.00957
-	ampB = 26.852
-	ampC = 10.2
-	bmpA = 0.0002401
-	bmpB = 33.8333
-	bmpC = 10
+    ampA = 0.00957
+    ampB = 26.852
+    ampC = 10.2
+    bmpA = 0.0002401
+    bmpB = 33.8333
+    bmpC = 10
 
     : fast Na+
-	amA = 1.77753
-	amB = 20.1795
-	amC = 10.3
-	bmA = 0.0823
-	bmB = 25.4746
-	bmC = 9.16
-	ahA = 0.075286
-	ahB = 112.7124
-	ahC = 8.3910
-	bhA = 2.8083
-	bhB = 30.5435
-	bhC = 10.2263
+    amA = 1.77753
+    amB = 20.1795
+    amC = 10.3
+    bmA = 0.0823
+    bmB = 25.4746
+    bmC = 9.16
+    ahA = 0.075286
+    ahB = 112.7124
+    ahC = 8.3910
+    bhA = 2.8083
+    bhB = 30.5435
+    bhC = 10.2263
 
     : slow K+
-	asA = 0.3
-	asB = -27
-	asC = -5
-	bsA = 0.03
-	bsB = 10
-	bsC = -1
+    asA = 0.3
+    asB = -27
+    asC = -5
+    bsA = 0.03
+    bsB = 10
+    bsC = -1
 
     : fast K+
-	anA = 0.0462
-	anB = -83.2
-	anC = 1.1
-	bnA = 0.0824
-	bnB = -66
-	bnC = 10.5
+    anA = 0.0462
+    anB = -83.2
+    anC = 1.1
+    bnA = 0.0824
+    bnB = -66
+    bnC = 10.5
 }
 
 STATE {
-	mp m h s n
+    mp m h s n
 }
 
 ASSIGNED {
-	inap    (mA/cm2)
-	ina	(mA/cm2)
-	ik      (mA/cm2)
-	il      (mA/cm2)
-	ikf	(mA/cm2)
-	mp_inf
-	m_inf
-	h_inf
-	s_inf
-	n_inf
-	tau_mp
-	tau_m
-	tau_h
-	tau_s
-	tau_n
-	q10_1
-	q10_2
-	q10_3
+    gnap    (mho/cm2)
+    gna     (mho/cm2)
+    gk      (mho/cm2)
+    gkf     (mho/cm2)
+    inap    (mA/cm2)
+    ina	(mA/cm2)
+    ik      (mA/cm2)
+    il      (mA/cm2)
+    ikf	(mA/cm2)
+    mp_inf
+    m_inf
+    h_inf
+    s_inf
+    n_inf
+    tau_mp
+    tau_m
+    tau_h
+    tau_s
+    tau_n
+    q10_1
+    q10_2
+    q10_3
 }
 
 BREAKPOINT {
-	SOLVE states METHOD cnexp
-	inap = gnapbar * mp*mp*mp * (v - ena)  : slow sodium
-	ina = gnabar * m*m*m*h * (v - ena) : fast sodium
-	ik   = gkbar * s * (v - ek) : slow potassium
-	il   = gl * (v - el) : leak
-	ikf = gkf * n*n*n*n* (v-ekf) : fast potassium
+    SOLVE states METHOD cnexp
+    gnap = gnapbar * mp*mp*mp
+    inap = gnap * (v - ena)  : slow sodium
+    gna = gnabar * m*m*m*h
+    ina = gna * (v - ena) : fast sodium
+    gk = gkbar * s
+    ik = gk * (v - ek) : slow potassium
+    il = gl * (v - el) : leak
+    gkf = gkfbar * n*n*n*n
+    ikf = gkf * (v-ekf) : fast potassium
 }
 
 DERIVATIVE states {   : exact Hodgkin-Huxley equations
-       evaluate_fct(v)
-	mp'= (mp_inf - mp) / tau_mp
-	m' = (m_inf - m) / tau_m
-	h' = (h_inf - h) / tau_h
-	s' = (s_inf - s) / tau_s
-	n' = (n_inf - n) / tau_n  : fast potassium
+    evaluate_fct(v)
+    mp'= (mp_inf - mp) / tau_mp
+    m' = (m_inf - m) / tau_m
+    h' = (h_inf - h) / tau_h
+    s' = (s_inf - s) / tau_s
+    n' = (n_inf - n) / tau_n  : fast potassium
 }
 
 UNITSOFF
@@ -160,99 +169,99 @@ INITIAL {
 :   Temperature dependence
 :
 
-	q10_1 = 2.2 ^ ((celsius-20)/ 10 )
-	q10_2 = 2.9 ^ ((celsius-20)/ 10 )
-	q10_3 = 3.0 ^ ((celsius-36)/ 10 )
+    q10_1 = 2.2 ^ ((celsius-20)/ 10 )
+    q10_2 = 2.9 ^ ((celsius-20)/ 10 )
+    q10_3 = 3.0 ^ ((celsius-36)/ 10 )
 
-	evaluate_fct(v)
-	mp = mp_inf
-	m = m_inf
-	h = h_inf
-	s = s_inf
-	n = n_inf
+    evaluate_fct(v)
+    mp = mp_inf
+    m = m_inf
+    h = h_inf
+    s = s_inf
+    n = n_inf
 }
 
 PROCEDURE evaluate_fct(v(mV)) { LOCAL a,b,v2
 
     : persistent Na+
-	a = q10_1*vtrap1(v)
-	b = q10_1*vtrap2(v)
-	tau_mp = 1 / (a + b)
-	mp_inf = a / (a + b)
+    a = q10_1*vtrap1(v)
+    b = q10_1*vtrap2(v)
+    tau_mp = 1 / (a + b)
+    mp_inf = a / (a + b)
 
     : fast Na+
-	a = q10_1*vtrap6(v)
-	b = q10_1*vtrap7(v)
-	tau_m = 1 / (a + b)
-	m_inf = a / (a + b)
+    a = q10_1*vtrap6(v)
+    b = q10_1*vtrap7(v)
+    tau_m = 1 / (a + b)
+    m_inf = a / (a + b)
 
-	a = q10_2*vtrap8(v)
-	b = q10_2*bhA / (1 + Exp(-(v+bhB)/bhC))
-	tau_h = 1 / (a + b)
-	h_inf = a / (a + b)
+    a = q10_2*vtrap8(v)
+    b = q10_2*bhA / (1 + Exp(-(v+bhB)/bhC))
+    tau_h = 1 / (a + b)
+    h_inf = a / (a + b)
 
-	v2 = v - vtraub : convert to traub convention
+    v2 = v - vtraub : convert to traub convention
 
     : slow K+
-	a = q10_3*asA / (Exp((v2+asB)/asC) + 1) 
-	b = q10_3*bsA / (Exp((v2+bsB)/bsC) + 1)
-	tau_s = 1 / (a + b)
-	s_inf = a / (a + b)
+    a = q10_3*asA / (Exp((v2+asB)/asC) + 1) 
+    b = q10_3*bsA / (Exp((v2+bsB)/bsC) + 1)
+    tau_s = 1 / (a + b)
+    s_inf = a / (a + b)
 
     : fast K+
-	a = q10_3*vtrapNA(v)
-	b = q10_3*vtrapNB(v)
-	tau_n = 1 / (a + b)
-	n_inf = a / (a + b)
+    a = q10_3*vtrapNA(v)
+    b = q10_3*vtrapNB(v)
+    tau_n = 1 / (a + b)
+    n_inf = a / (a + b)
 }
 
 : vtrap functions to prevent discontinuity
 FUNCTION vtrap(x) {
-	if (x < -50) {
-		vtrap = 0
-	}else{
-		vtrap = bsA / (Exp((x+bsB)/bsC) + 1)
-	}
+    if (x < -50) {
+        vtrap = 0
+    }else{
+        vtrap = bsA / (Exp((x+bsB)/bsC) + 1)
+    }
 }
 
 FUNCTION vtrap1(x) {
-	if (fabs((x+ampB)/ampC) < 1e-6) {
-		vtrap1 = ampA*ampC
-	}else{
-		vtrap1 = (ampA*(x+ampB)) / (1 - Exp(-(x+ampB)/ampC))
-	}
+    if (fabs((x+ampB)/ampC) < 1e-6) {
+        vtrap1 = ampA*ampC
+    }else{
+        vtrap1 = (ampA*(x+ampB)) / (1 - Exp(-(x+ampB)/ampC))
+    }
 }
 
 FUNCTION vtrap2(x) {
-	if (fabs((x+bmpB)/bmpC) < 1e-6) {
-		vtrap2 = bmpA*bmpC : Ted Carnevale minus sign bug fix
-	}else{
-		vtrap2 = (bmpA*(-(x+bmpB))) / (1 - Exp((x+bmpB)/bmpC))
-	}
+    if (fabs((x+bmpB)/bmpC) < 1e-6) {
+        vtrap2 = bmpA*bmpC : Ted Carnevale minus sign bug fix
+    }else{
+        vtrap2 = (bmpA*(-(x+bmpB))) / (1 - Exp((x+bmpB)/bmpC))
+    }
 }
 
 FUNCTION vtrap6(x) {
-	if (fabs((x+amB)/amC) < 1e-6) {
-		vtrap6 = amA*amC
-	}else{
-		vtrap6 = (amA*(x+amB)) / (1 - Exp(-(x+amB)/amC))
-	}
+    if (fabs((x+amB)/amC) < 1e-6) {
+        vtrap6 = amA*amC
+    }else{
+        vtrap6 = (amA*(x+amB)) / (1 - Exp(-(x+amB)/amC))
+    }
 }
 
 FUNCTION vtrap7(x) {
-	if (fabs((x+bmB)/bmC) < 1e-6) {
-		vtrap7 = bmA*bmC : Ted Carnevale minus sign bug fix
-	}else{
-		vtrap7 = (bmA*(-(x+bmB))) / (1 - Exp((x+bmB)/bmC))
-	}
+    if (fabs((x+bmB)/bmC) < 1e-6) {
+        vtrap7 = bmA*bmC : Ted Carnevale minus sign bug fix
+    }else{
+        vtrap7 = (bmA*(-(x+bmB))) / (1 - Exp((x+bmB)/bmC))
+    }
 }
 
 FUNCTION vtrap8(x) {
-	if (fabs((x+ahB)/ahC) < 1e-6) {
-		vtrap8 = ahA*ahC : Ted Carnevale minus sign bug fix
-	}else{
-		vtrap8 = (ahA*(-(x+ahB))) / (1 - Exp((x+ahB)/ahC)) 
-	}
+    if (fabs((x+ahB)/ahC) < 1e-6) {
+        vtrap8 = ahA*ahC : Ted Carnevale minus sign bug fix
+    }else{
+        vtrap8 = (ahA*(-(x+ahB))) / (1 - Exp((x+ahB)/ahC)) 
+    }
 }
 
 FUNCTION vtrapNA(x){
@@ -272,11 +281,11 @@ FUNCTION vtrapNB(x){
 }
 
 FUNCTION Exp(x) {
-	if (x < -100) {
-		Exp = 0
-	}else{
-		Exp = exp(x)
-	}
+    if (x < -100) {
+        Exp = 0
+    }else{
+        Exp = exp(x)
+    }
 }
 
 UNITSON
\ No newline at end of file
diff --git a/nrv/_misc/mods/stin_motor.mod b/nrv/_misc/mods/stin_motor.mod
index e886ff07..a9d3d1a0 100644
--- a/nrv/_misc/mods/stin_motor.mod
+++ b/nrv/_misc/mods/stin_motor.mod
@@ -31,102 +31,109 @@ TITLE Motor Axon Stin channels
 INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
 
 NEURON {
-	SUFFIX stin_motor
-	NONSPECIFIC_CURRENT ik
-	NONSPECIFIC_CURRENT il
-	NONSPECIFIC_CURRENT iq
-	NONSPECIFIC_CURRENT ikf
-	RANGE gkbar, gl, gq, gkf, ek, el, eq, ekf
-	RANGE s_inf, q_inf, n_inf
-	RANGE tau_s, tau_q, tau_n
+    SUFFIX stin_motor
+    NONSPECIFIC_CURRENT ik
+    NONSPECIFIC_CURRENT il
+    NONSPECIFIC_CURRENT iq
+    NONSPECIFIC_CURRENT ikf
+    RANGE gkbar, gl, gqbar, gkfbar, ek, el, eq, ekf
+    RANGE gk, gq, gkf
+    RANGE s_inf, q_inf, n_inf
+    RANGE tau_s, tau_q, tau_n
 }
 
 
 UNITS {
-	(mA) = (milliamp)
-	(mV) = (millivolt)
+    (mA) = (milliamp)
+    (mV) = (millivolt)
 }
 
 PARAMETER {
 
     : conductance values
-	gkbar   = 0.002581 (mho/cm2)
-	gl	= 0.0002 (mho/cm2)
-	gq	= 0.002232 (mho/cm2)
-	gkf	= 0.02568 (mho/cm2)
+    gkbar   = 0.002581 (mho/cm2)
+    gl	= 0.0002 (mho/cm2)
+    gqbar	= 0.002232 (mho/cm2)
+    gkfbar	= 0.02568 (mho/cm2)
 
     : reversal potentials
-	ek      = -90.0 (mV)
-	el	= -90.0 (mV)
-	eq	= -54.9 (mV)
-	ekf	= -90.0 (mV)
+    ek      = -90.0 (mV)
+    el	= -90.0 (mV)
+    eq	= -54.9 (mV)
+    ekf	= -90.0 (mV)
 
     : read in from .hoc file
-	celsius		(degC)
-	dt              (ms)
-	v               (mV)
-	vtraub=-80
+    celsius		(degC)
+    dt              (ms)
+    v               (mV)
+    vtraub=-80
 
     : parameters determining rate constants
 
     : slow K+
-	asA = 0.3
-	asB = -27
-	asC = -5
-	bsA = 0.03
-	bsB = 10
-	bsC = -1
+    asA = 0.3
+    asB = -27
+    asC = -5
+    bsA = 0.03
+    bsB = 10
+    bsC = -1
 
     : HCN
-	aqA = .00522
-	aqB = -107.3
-	aqC = -12.2
-	bqA = .00522
-	bqB = -107.3
-	bqC = -12.2
+    aqA = .00522
+    aqB = -107.3
+    aqC = -12.2
+    bqA = .00522
+    bqB = -107.3
+    bqC = -12.2
 
     : fast K+
-	anA = 0.0462
-	anB = -83.2
-	anC = 1.1
-	bnA = 0.0824
-	bnB = -66
-	bnC = 10.5
+    anA = 0.0462
+    anB = -83.2
+    anC = 1.1
+    bnA = 0.0824
+    bnB = -66
+    bnC = 10.5
 }
 
 STATE {
-	s q n
+    s q n
 }
 
 ASSIGNED {
-	ik      (mA/cm2)
-	il      (mA/cm2)
-	iq	(mA/cm2)
-	ikf	(mA/cm2)
-	s_inf
-	q_inf
-	n_inf
-	tau_s	(ms)
-	tau_q	(ms)
-	tau_n	(ms)
-	q10_1
-	q10_2
-	q10_3
+    gk      (mho/cm2)
+    gq      (mho/cm2)
+    gkf     (mho/cm2)
+    ik      (mA/cm2)
+    il      (mA/cm2)
+    iq	(mA/cm2)
+    ikf	(mA/cm2)
+    s_inf
+    q_inf
+    n_inf
+    tau_s	(ms)
+    tau_q	(ms)
+    tau_n	(ms)
+    q10_1
+    q10_2
+    q10_3
 }
 
 BREAKPOINT {
-	SOLVE states METHOD cnexp
-	ik   = gkbar * s * (v - ek)
-	il   = gl * (v - el)
-	iq = gq * q * (v-eq)
-	ikf = gkf * n*n*n*n* (v-ekf)
+    SOLVE states METHOD cnexp
+    gk = gkbar * s
+    ik = gk * (v - ek)
+    il = gl * (v - el)
+    gq = gqbar * q
+    iq = gq * (v-eq)
+    gkf = gkfbar * n*n*n*n
+    ikf = gkf * (v-ekf)
 }
 
 DERIVATIVE states {   : exact Hodgkin-Huxley equations
-       evaluate_fct(v)
-	s' = (s_inf - s) / tau_s
-	q' = (q_inf - q) / tau_q
-	n' = (n_inf - n) / tau_n
+    evaluate_fct(v)
+    s' = (s_inf - s) / tau_s
+    q' = (q_inf - q) / tau_q
+    n' = (n_inf - n) / tau_n
 }
 
 UNITSOFF
@@ -137,37 +144,37 @@ INITIAL {
 :   Temperature dependence
 :
 
-	q10_1 = 2.2 ^ ((celsius-20)/ 10 )
-	q10_2 = 2.9 ^ ((celsius-20)/ 10 )
-	q10_3 = 3.0 ^ ((celsius-36)/ 10 )
+    q10_1 = 2.2 ^ ((celsius-20)/ 10 )
+    q10_2 = 2.9 ^ ((celsius-20)/ 10 )
+    q10_3 = 3.0 ^ ((celsius-36)/ 10 )
 
-	evaluate_fct(v)
-	s = s_inf
-	q = q_inf
-	n = n_inf
+    evaluate_fct(v)
+    s = s_inf
+    q = q_inf
+    n = n_inf
 }
 
 PROCEDURE evaluate_fct(v(mV)) { LOCAL a,b,v2
 
-	v2 = v - vtraub : convert to traub convention
+    v2 = v - vtraub : convert to traub convention
 
     : slow K+
-	a = q10_3*asA / (Exp((v2+asB)/asC) + 1) 
-	b = q10_3*bsA / (Exp((v2+bsB)/bsC) + 1)
-	tau_s = 1 / (a + b)
-	s_inf = a / (a + b)
+    a = q10_3*asA / (Exp((v2+asB)/asC) + 1) 
+    b = q10_3*bsA / (Exp((v2+bsB)/bsC) + 1)
+    tau_s = 1 / (a + b)
+    s_inf = a / (a + b)
 
     : HCN
-	a = q10_3*aqA * (Exp((v-aqB)/aqC)) 
-	b = q10_3*bqA / (Exp((v-bqB)/bqC))
-	tau_q = 1 / (a + b)
-	q_inf = a / (a + b)
+    a = q10_3*aqA * (Exp((v-aqB)/aqC)) 
+    b = q10_3*bqA / (Exp((v-bqB)/bqC))
+    tau_q = 1 / (a + b)
+    q_inf = a / (a + b)
 
     : fast K+
-	a = q10_3*vtrapNA(v)
-	b = q10_3*vtrapNB(v)
-	tau_n = 1 / (a + b)
-	n_inf = a / (a + b)
+    a = q10_3*vtrapNA(v)
+    b = q10_3*vtrapNB(v)
+    tau_n = 1 / (a + b)
+    n_inf = a / (a + b)
 }
 
 : vtrap functions to prevent discontinuity
@@ -188,11 +195,11 @@ FUNCTION vtrapNB(x){
 }
 
 FUNCTION Exp(x) {
-	if (x < -100) {
-		Exp = 0
-	}else{
-		Exp = exp(x)
-	}
+    if (x < -100) {
+        Exp = 0
+    }else{
+        Exp = exp(x)
+    }
 }
 
 UNITSON
\ No newline at end of file
diff --git a/nrv/_misc/mods/stin_sensory.mod b/nrv/_misc/mods/stin_sensory.mod
index c86a7a5d..f032f61d 100644
--- a/nrv/_misc/mods/stin_sensory.mod
+++ b/nrv/_misc/mods/stin_sensory.mod
@@ -31,102 +31,109 @@ TITLE Sensory Axon Stin channels
 INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
 
 NEURON {
-	SUFFIX stin_sensory
-	NONSPECIFIC_CURRENT ik
-	NONSPECIFIC_CURRENT il
-	NONSPECIFIC_CURRENT iq
-	NONSPECIFIC_CURRENT ikf
-	RANGE gkbar, gl, gq, gkf, ek, el, eq, ekf
-	RANGE s_inf, q_inf, n_inf
-	RANGE tau_s, tau_q, tau_n
+    SUFFIX stin_sensory
+    NONSPECIFIC_CURRENT ik
+    NONSPECIFIC_CURRENT il
+    NONSPECIFIC_CURRENT iq
+    NONSPECIFIC_CURRENT ikf
+    RANGE gkbar, gl, gqbar, gkfbar, ek, el, eq, ekf
+    RANGE gk, gq, gkf
+    RANGE s_inf, q_inf, n_inf
+    RANGE tau_s, tau_q, tau_n
 }
 
 
 UNITS {
-	(mA) = (milliamp)
-	(mV) = (millivolt)
+    (mA) = (milliamp)
+    (mV) = (millivolt)
 }
 
 PARAMETER {
 
     : channel conductances
-	gkbar   = 0.001324 (mho/cm2)
-	gl	= 0.0001716 (mho/cm2)
-	gq	= 0.003102 (mho/cm2)
-	gkf	= 0.02737 (mho/cm2)
+    gkbar   = 0.001324 (mho/cm2)
+    gl	= 0.0001716 (mho/cm2)
+    gqbar	= 0.003102 (mho/cm2)
+    gkfbar	= 0.02737 (mho/cm2)
 
     : reversal potentials
-	ek      = -90.0 (mV)
-	el	= -90.0 (mV)
-	eq	= -54.9 (mV)
-	ekf	= -90.0 (mV)
+    ek      = -90.0 (mV)
+    el	= -90.0 (mV)
+    eq	= -54.9 (mV)
+    ekf	= -90.0 (mV)
     
     : read in from .hoc file
-	celsius		(degC)
-	dt              (ms)
-	v               (mV)
-	vtraub=-80
+    celsius		(degC)
+    dt              (ms)
+    v               (mV)
+    vtraub=-80
 
     : parameters determining rate constants
 
     : slow K+
-	asA = 0.3
-	asB = -27
-	asC = -5
-	bsA = 0.03
-	bsB = 10
-	bsC = -1
+    asA = 0.3
+    asB = -27
+    asC = -5
+    bsA = 0.03
+    bsB = 10
+    bsC = -1
 
     : HCN
-	aqA = .00522
-	aqB = -94.2
-	aqC = -12.2
-	bqA = .00522
-	bqB = -94.2
-	bqC = -12.2
+    aqA = .00522
+    aqB = -94.2
+    aqC = -12.2
+    bqA = .00522
+    bqB = -94.2
+    bqC = -12.2
 
     : fast K+
-	anA = 0.0462
-	anB = -83.2
-	anC = 1.1
-	bnA = 0.0824
-	bnB = -66
-	bnC = 10.5
+    anA = 0.0462
+    anB = -83.2
+    anC = 1.1
+    bnA = 0.0824
+    bnB = -66
+    bnC = 10.5
 }
 
 STATE {
-	s q n
+    s q n
 }
 
 ASSIGNED {
-	ik      (mA/cm2)
-	il      (mA/cm2)
-	iq	(mA/cm2)
-	ikf	(mA/cm2)
-	s_inf
-	q_inf
-	n_inf
-	tau_s
-	tau_q
-	tau_n
-	q10_1
-	q10_2
-	q10_3
+    gk      (mho/cm2)
+    gq      (mho/cm2)
+    gkf     (mho/cm2)
+    ik      (mA/cm2)
+    il      (mA/cm2)
+    iq	(mA/cm2)
+    ikf	(mA/cm2)
+    s_inf
+    q_inf
+    n_inf
+    tau_s
+    tau_q
+    tau_n
+    q10_1
+    q10_2
+    q10_3
 }
 
 BREAKPOINT {
-	SOLVE states METHOD cnexp
-	ik   = gkbar * s * (v - ek)
-	il   = gl * (v - el)
-	iq = gq * q * (v-eq)
-	ikf = gkf * n*n*n*n* (v-ekf)
+    SOLVE states METHOD cnexp
+    gk = gkbar * s
+    ik = gk * (v - ek)
+    il = gl * (v - el)
+    gq = gqbar * q
+    iq = gq * (v - eq)
+    gkf = gkfbar * n*n*n*n
+    ikf = gkf * (v - ekf)
 }
 
 DERIVATIVE states {   : exact Hodgkin-Huxley equations
-       evaluate_fct(v)
-	s' = (s_inf - s) / tau_s
-	q' = (q_inf - q) / tau_q
-	n' = (n_inf - n) / tau_n
+    evaluate_fct(v)
+    s' = (s_inf - s) / tau_s
+    q' = (q_inf - q) / tau_q
+    n' = (n_inf - n) / tau_n
 }
 
 UNITSOFF
@@ -137,37 +144,37 @@ INITIAL {
 :   Temperature dependence
 :
 
-	q10_1 = 2.2 ^ ((celsius-20)/ 10 )
-	q10_2 = 2.9 ^ ((celsius-20)/ 10 )
-	q10_3 = 3.0 ^ ((celsius-36)/ 10 )
+    q10_1 = 2.2 ^ ((celsius-20)/ 10 )
+    q10_2 = 2.9 ^ ((celsius-20)/ 10 )
+    q10_3 = 3.0 ^ ((celsius-36)/ 10 )
 
-	evaluate_fct(v)
-	s = s_inf
-	q = q_inf
-	n = n_inf
+    evaluate_fct(v)
+    s = s_inf
+    q = q_inf
+    n = n_inf
 }
 
 PROCEDURE evaluate_fct(v(mV)) { LOCAL a,b,v2
 
-	v2 = v - vtraub : convert to traub convention
+    v2 = v - vtraub : convert to traub convention
 
     : slow K+
-	a = q10_3*asA / (Exp((v2+asB)/asC) + 1) 
-	b = q10_3*bsA / (Exp((v2+bsB)/bsC) + 1)
-	tau_s = 1 / (a + b)
-	s_inf = a / (a + b)
+    a = q10_3*asA / (Exp((v2+asB)/asC) + 1) 
+    b = q10_3*bsA / (Exp((v2+bsB)/bsC) + 1)
+    tau_s = 1 / (a + b)
+    s_inf = a / (a + b)
 
     : HCN
-	a = q10_3*aqA * (Exp((v-aqB)/aqC)) 
-	b = q10_3*bqA / (Exp((v-bqB)/bqC))
-	tau_q = 1 / (a + b)
-	q_inf = a / (a + b)
+    a = q10_3*aqA * (Exp((v-aqB)/aqC)) 
+    b = q10_3*bqA / (Exp((v-bqB)/bqC))
+    tau_q = 1 / (a + b)
+    q_inf = a / (a + b)
 
     : fast K+
-	a = q10_3*vtrapNA(v) 
-	b = q10_3*vtrapNB(v)
-	tau_n = 1 / (a + b)
-	n_inf = a / (a + b)
+    a = q10_3*vtrapNA(v) 
+    b = q10_3*vtrapNB(v)
+    tau_n = 1 / (a + b)
+    n_inf = a / (a + b)
 }
 
 : vtrap functions to prevent discontinuity
@@ -188,11 +195,11 @@ FUNCTION vtrapNB(x){
 }
 
 FUNCTION Exp(x) {
-	if (x < -100) {
-		Exp = 0
-	}else{
-		Exp = exp(x)
-	}
+    if (x < -100) {
+        Exp = 0
+    }else{
+        Exp = exp(x)
+    }
 }
 
 UNITSON
\ No newline at end of file
diff --git a/nrv/backend/MCore.py b/nrv/backend/MCore.py
index 13fa1ce2..e6d77373 100644
--- a/nrv/backend/MCore.py
+++ b/nrv/backend/MCore.py
@@ -4,6 +4,7 @@
 (c) ETIS - University Cergy-Pontoise - CNRS
 """
 import numpy as np
+from .NRV_Singleton import NRV_singleton
 
 try:
     import mpi4py.MPI as mpi
@@ -14,7 +15,7 @@
     MCore_Flag = False
 
 
-class Mcore_handler:
+class Mcore_handler(metaclass=NRV_singleton):
     """
     Class to handle parallel processing (cores, no threads) in NRV2
     """
diff --git a/nrv/backend/NRV_Class.py b/nrv/backend/NRV_Class.py
index 92cecc05..67ff4cff 100644
--- a/nrv/backend/NRV_Class.py
+++ b/nrv/backend/NRV_Class.py
@@ -98,7 +98,7 @@ def __del__(self):
         """
         pass_debug_info(self.nrv_type, " deleted")
 
-    def save(self, save=False, fname="nrv_save.json", blacklist={}, **kwargs):
+    def save(self, save=False, fname="nrv_save.json", blacklist=[], **kwargs):
         """
         Generic saving method for NRV class instance
 
diff --git a/nrv/backend/NRV_Singleton.py b/nrv/backend/NRV_Singleton.py
new file mode 100644
index 00000000..b3a8ebf6
--- /dev/null
+++ b/nrv/backend/NRV_Singleton.py
@@ -0,0 +1,24 @@
+"""
+Access and modify NRV Parameters
+Authors: Florian Kolbl / Roland Giraud / Louis Regnacq / Thomas Couppey
+(c) ETIS - University Cergy-Pontoise - CNRS
+"""
+
+# from .log_interface import rise_warning
+
+
+class NRV_singleton(type):
+    """
+    Should be used as metaclass to define singleton classes
+
+    """
+
+    _instances = {}
+
+    def __call__(cls, *args, **kwargs):
+        if cls not in cls._instances:
+            cls._instances[cls] = super(NRV_singleton, cls).__call__(*args, **kwargs)
+        else:
+            print("WARNING : Class", cls, "is a sigleton cannot be re-instantiated")
+            # rise_warning('Class', cls, 'is a sigleton cannot be re-instantiated')
+        return cls._instances[cls]
diff --git a/nrv/backend/file_handler.py b/nrv/backend/file_handler.py
index 0c087d3a..60ab35ce 100644
--- a/nrv/backend/file_handler.py
+++ b/nrv/backend/file_handler.py
@@ -86,6 +86,33 @@ def create_folder(foldername, access_rights=0o755):
 #######################
 ## JSON related code ##
 #######################
+def check_json_fname(fname):
+    """
+    Add ".json" extension is missing at the end of the file name and check if it exists.
+
+    Parameters
+    ----------
+    fname    : str
+        name of the file
+
+    Retruns
+    -------
+    fname    : str
+        name of the file with the ".json" extension added if required
+
+    Errors
+    ------
+    NRV_Error
+        rised if fname does not exist
+    """
+    if fname[-5:] != ".json":
+        fname += ".json"
+    if os.path.isfile(fname):
+        return fname
+    else:
+        rise_error(fname + " not found cannot be load")
+
+
 def json_dump(results, filename):
     """
     save stuff as a json file
@@ -115,7 +142,7 @@ def json_load(filename):
     results : dictionary
         stuff from file
     """
-    with open(filename, "r") as file_to_read:
+    with open(check_json_fname(filename), "r") as file_to_read:
         results = json.load(file_to_read)
     return results
 
diff --git a/nrv/backend/log_interface.py b/nrv/backend/log_interface.py
index c651e395..b17f5f4c 100644
--- a/nrv/backend/log_interface.py
+++ b/nrv/backend/log_interface.py
@@ -114,10 +114,10 @@ def rise_warning(*args, abort=False, **kwargs):
         if parameters.LOG_Status:
             logging.warning(war)
         if MCH.do_master_only_work() and parameters.VERBOSITY_LEVEL >= 2:
-            print(bcolors.WARNING + war+ bcolors.ENDC)
+            print(bcolors.WARNING + war + bcolors.ENDC)
             sys.stdout.flush()
         elif parameters.VERBOSITY_LEVEL >= 4:
-            print(bcolors.WARNING + war+ bcolors.ENDC)
+            print(bcolors.WARNING + war + bcolors.ENDC)
             sys.stdout.flush()
     if abort:
         sys.exit(0)
diff --git a/nrv/backend/parameters.py b/nrv/backend/parameters.py
index 0b046ad3..4e03a49a 100644
--- a/nrv/backend/parameters.py
+++ b/nrv/backend/parameters.py
@@ -6,8 +6,10 @@
 import configparser
 import os
 
+from .NRV_Singleton import NRV_singleton
 
-class nrv_parameters:
+
+class nrv_parameters(metaclass=NRV_singleton):
     """
     A class for NRV parameters used to gather parameters
     """
@@ -81,6 +83,5 @@ def set_gmsh_ncore(self, n):
 ###########################
 #   Parameter singleton   #
 ###########################
-# TO DO
 
 parameters = nrv_parameters()
diff --git a/nrv/fmod/FEM/COMSOL_model.py b/nrv/fmod/FEM/COMSOL_model.py
index a165889e..70e3d1f0 100644
--- a/nrv/fmod/FEM/COMSOL_model.py
+++ b/nrv/fmod/FEM/COMSOL_model.py
@@ -12,6 +12,8 @@
 import numpy as np
 
 from ...backend.file_handler import rmv_ext
+from ...backend.MCore import MCH
+from ...backend.log_interface import rise_warning
 from ...utils.units import V
 from .FEM import *
 
@@ -63,8 +65,7 @@ def __init__(self, fname, Ncore=None, handle_server=False):
             # self.model_path = fname
             if self.Ncore is None:
                 self.Ncore = COMSOL_Ncores
-            else:
-                self.Ncore = Ncore
+            self.is_multi_proc = self.Ncore > 1 and not MCH.is_alone()
             self.handle_server = handle_server
             # start client and server
             pass_info("Starting COMSOL server/client, this may take few seconds")
diff --git a/nrv/fmod/FEM/FEM.py b/nrv/fmod/FEM/FEM.py
index 804d2ac2..f02f84d5 100644
--- a/nrv/fmod/FEM/FEM.py
+++ b/nrv/fmod/FEM/FEM.py
@@ -5,7 +5,8 @@
 """
 from abc import abstractmethod
 
-from ...backend.log_interface import pass_info
+from ...backend.MCore import MCH
+from ...backend.log_interface import pass_info, rise_warning
 from ...backend.NRV_Class import NRV_class
 
 ###############
@@ -34,6 +35,7 @@ def __init__(self, Ncore=None):
         """
         super().__init__()
         self.Ncore = Ncore
+        self.is_multi_proc = False
         self.type = "FEM"
 
         # Timmers
@@ -48,7 +50,23 @@ def __init__(self, Ncore=None):
 
     def get_timers(self, verbose=False):
         """
-        TO BE COMPLETED
+        Returns the timers of each step of the FEM computation
+
+        Parameters
+        ----------
+        verbose     : bool
+            if true, timer are also passed to the log and the terminal (if verbosity level > 2)
+
+        Returns
+        -------
+        meshing_timer   : float
+            time spent to mesh the FEM problem, in s
+        preparing_timer   : float
+            time spent to mesh the prepare (i.e. generating variab connecting to the server), in s
+        solving_timer   : float
+            time spent to mesh the FEM problem, in s
+        total_timer   : float
+            time spent to mesh the FEM problem, in s
         """
         pass_info("mesh done in " + str(self.meshing_timer) + " s")
         pass_info("simulation prepared in " + str(self.preparing_timer) + " s")
@@ -62,3 +80,20 @@ def get_timers(self, verbose=False):
         )
         pass_info("total duration " + str(total_timer) + " s")
         return self.meshing_timer, self.preparing_timer, self.solving_timer, total_timer
+
+    def set_Ncore(self, N):
+        """
+        Set the number of cores to use for the FEM
+
+        Parameters
+        ----------
+        N       : int
+            Number of cores to set
+        """
+        self.Ncore = N
+        if self.Ncore > MCH.size:
+            rise_warning(
+                "MCH size is " + str(MCH.size) + " cannot set FEM on more processes"
+            )
+            self.Ncore = MCH.size
+        self.is_multi_proc = self.Ncore > 1
diff --git a/nrv/fmod/FEM/FENICS_model.py b/nrv/fmod/FEM/FENICS_model.py
index 4d90af0a..c3409b88 100644
--- a/nrv/fmod/FEM/FENICS_model.py
+++ b/nrv/fmod/FEM/FENICS_model.py
@@ -8,13 +8,16 @@
 import time
 
 import numpy as np
+from mpi4py import MPI
 
 from ...backend.file_handler import rmv_ext
-from ...utils.units import V
-from .FEM import *
-from .fenics_utils.FEMSimulation import *
-from .fenics_utils.SimResult import *
-from .mesh_creator.NerveMshCreator import *
+from ...utils.units import V, mm
+from ...backend.MCore import MCH, synchronize_processes
+from .fenics_utils.FEMSimulation import FEMSimulation
+
+from .FEM import FEM_model
+from .fenics_utils.SimResult import save_sim_res_list
+from .mesh_creator.NerveMshCreator import NerveMshCreator, ENT_DOM_offset, pi
 
 # built in FENICS models
 dir_path = os.environ["NRVPATH"] + "/_misc"
@@ -27,7 +30,7 @@
 config_fname = dir_path + "/NRV.ini"
 machine_config.read(config_fname)
 
-FENICS_Ncores = machine_config.get("FENICS", "FENICS_CPU")
+FENICS_Ncores = int(machine_config.get("FENICS", "FENICS_CPU"))
 FENICS_Status = machine_config.get("FENICS", "FENICS_STATUS") == "True"
 
 fem_verbose = True
@@ -44,7 +47,7 @@ def __init__(
         Ncore=None,
         handle_server=False,
         elem=None,
-        comm=MPI.COMM_SELF,
+        comm="default",
         rank=0,
     ):
         """
@@ -105,7 +108,12 @@ def __init__(
         self.sim_res = []
 
         # Mcore attributes
-        self.comm = comm
+        if self.Ncore is None:
+            self.Ncore = FENICS_Ncores
+        self.comm = None
+        self.set_Ncore(self.Ncore)
+        if comm != "default":
+            self.comm = comm
         self.rank = rank
 
         # Status
@@ -186,6 +194,21 @@ def load_from_parameters(self, **param):
     #############################
     ## Access model parameters ##
     #############################
+    def set_Ncore(self, N):
+        """
+        Set the number of cores to use for the FEM
+
+        Parameters
+        ----------
+        N       : int
+            Number of cores to set
+        """
+        super().set_Ncore(N)
+        if self.is_multi_proc:
+            self.comm = MPI.COMM_WORLD
+        else:
+            self.comm = MPI.COMM_SELF
+
     def get_parameters(self):
         """
         Get the  all the parameters in the model as a python dictionary.
@@ -214,20 +237,28 @@ def get_parameters(self):
         param["Istim"] = self.Istim
         return param
 
-    def __update_parameters(self):
+    def __update_parameters(self, bcast=False):
         """
         Internal use only: updates all the parameters from the mesh
+
+        Parameters
+        ----------
+        bcast       : bool
+            if true the parameters are updated on all process
         """
-        param = self.mesh.get_parameters()
-        self.L = param["L"]
-        self.y_c = param["y_c"]
-        self.z_c = param["z_c"]
-        self.Outer_D = param["Outer_D"]
-        self.Nerve_D = param["Nerve_D"]
-        self.N_fascicle = param["N_fascicle"]
-        self.fascicles = param["fascicles"]
-        self.N_electrode = param["N_electrode"]
-        self.electrodes = param["electrodes"]
+        if MCH.do_master_only_work():
+            if bcast:
+                self.__update_parameters(bcast=False)
+                param = self.get_parameters()
+            else:
+                param = self.mesh.get_parameters()
+        else:
+            param = None
+        if bcast:
+            param = MCH.master_broadcasts_array_to_all(param)
+        if MCH.do_master_only_work() ^ bcast:
+            for key in param:
+                self.__dict__[key] = param[key]
 
     def reset_parameters(self):
         """
@@ -253,13 +284,16 @@ def reset_parameters(self):
         self.is_computed = False
         del self.mesh
         if not self.mesh_file_status:
-            self.mesh = NerveMshCreator(
-                Length=self.L,
-                Outer_D=self.Outer_D,
-                Nerve_D=self.Nerve_D,
-                y_c=self.y_c,
-                z_c=self.z_c,
-            )
+            if MCH.do_master_only_work:
+                self.mesh = NerveMshCreator(
+                    Length=self.L,
+                    Outer_D=self.Outer_D,
+                    Nerve_D=self.Nerve_D,
+                    y_c=self.y_c,
+                    z_c=self.z_c,
+                )
+            else:
+                self.mesh = None
 
     #####################
     ## customize model ##
@@ -362,18 +396,22 @@ def setup_simulations(self, comm=None, rank=None):
         """
         TO BE WRITTEN
         """
-        if self.comm is not None:
+        if comm is not None:
             self.comm = comm
-        if self.rank is not None:
+        if rank is not None:
             self.rank = rank
-
-        if self.is_meshed and not self.is_sim_ready:
+        if not self.is_meshed:
+            self.build_and_mesh()
+        if not self.is_sim_ready and (MCH.do_master_only_work() or self.is_multi_proc):
             t0 = time.time()
             # SETTING DOMAINS
             # del self.mesh
-            # sim = FEMSimulation(mesh_file=self.mesh_file, elem=self.elem, comm=self.comm, rank=self.rank)
             self.sim = FEMSimulation(
-                mesh_file=self.mesh_file, mesh=self.mesh, elem=self.elem
+                mesh_file=self.mesh_file,
+                mesh=self.mesh,
+                elem=self.elem,
+                comm=self.comm,
+                rank=self.rank,
             )
             # Outerbox domain
             self.sim.add_domain(
@@ -423,8 +461,11 @@ def setup_simulations(self, comm=None, rank=None):
                     variable=E_var,
                     mesh_domain_3D=mesh_domain_3D,
                 )
+            # set a parallelizable preconditionner if sim solve on multiple precesses
+            if self.is_multi_proc:
+                self.sim.set_solver_opt(pc_type="hypre")
             self.is_sim_ready = True
-        self.preparing_timer += time.time() - t0
+            self.preparing_timer += time.time() - t0
 
     def set_materials(
         self,
@@ -528,8 +569,11 @@ def build_and_mesh(self):
                     D=self.default_electrode["D"],
                     res=self.default_electrode["res"],
                 )
-            self.__update_parameters()
-            self.mesh.compute_mesh()
+            self.__update_parameters(bcast=self.is_multi_proc)
+            if MCH.do_master_only_work():
+                self.mesh.compute_mesh()
+            if self.is_multi_proc:
+                synchronize_processes()
             self.is_meshed = True
             self.mesh.get_info(verbose=True)
             self.meshing_timer += time.time() - t0
@@ -584,11 +628,11 @@ def get_potentials(self, x, y, z, E=-1):
             t0 = time.time()
             line = [[x_, y, z] for x_ in x]
             if self.N_electrode == 1 or (E < self.N_electrode and E >= 0):
-                potentials = self.sim_res[E].eval(line) * V
+                potentials = self.sim_res[E].eval(line, self.is_multi_proc) * V
             else:
                 potentials = []
                 for E in range(self.N_electrode):
-                    potentials += [self.sim_res[E].eval(line)]
+                    potentials += [self.sim_res[E].eval(line, self.is_multi_proc)]
                 potentials = np.transpose(np.array(potentials) * V)
             self.access_res_timer += time.time() - t0
             return potentials
diff --git a/nrv/fmod/FEM/fenics_utils/FEMSimulation.py b/nrv/fmod/FEM/fenics_utils/FEMSimulation.py
index 55cdc25d..2ae41ab3 100644
--- a/nrv/fmod/FEM/fenics_utils/FEMSimulation.py
+++ b/nrv/fmod/FEM/fenics_utils/FEMSimulation.py
@@ -26,10 +26,11 @@
 )
 
 from ....backend.log_interface import pass_info, rise_error, rise_warning
-from ....utils.units import *
-from .fenics_materials import *
-from .SimParameters import *
-from .SimResult import *
+from ....backend.file_handler import rmv_ext
+from ....utils.units import S, V, m
+from .fenics_materials import load_fenics_material
+from .SimParameters import SimParameters
+from .SimResult import read_gmsh, SimResult
 
 # Lists of available solvers and conditioners
 # go to https://petsc4py.readthedocs.io/en/stable/manual/ksp/ for more info
@@ -92,6 +93,7 @@
     "cholesky",
     "none",
     "shell",
+    "hypre",
 ]
 
 
@@ -618,7 +620,7 @@ def __merge_mixed_solutions(self):
         else:
             mixedvouts = self.mixedvout.split()
             for i in range(len(mixedvouts)):
-                self.mixedvouts[i].vector[:] = mixedvouts[i].vector[:]
+                self.mixedvouts[i].x.array[:] = mixedvouts[i].x.array
         self.vout = self.dg_problem.solve()
         return self.V_DG
 
@@ -647,8 +649,6 @@ def solve_and_save_sim(self, filename, save=True):
         return self.result
 
     def get_timers(self):
-        # return self.assembling_timer, self.solving_timer
-        # !!! FIXME: no self.assembling_timer
         return self.solving_timer
 
     def visualize_mesh(self):
@@ -659,8 +659,8 @@ def get_domain_potential(self, dom_id, dim=2, space=0):
             do = self.ds
         elif dim == 3:
             do = self.dx
-        S = assemble_scalar(form(1 * do(dom_id)))
+        Surf = assemble_scalar(form(1 * do(dom_id)))
         if self.to_merge:
-            return assemble_scalar(form(self.vout * do(dom_id))) / S * V
+            return assemble_scalar(form(self.vout * do(dom_id))) / Surf * V
         else:
-            return assemble_scalar(form(self.vout[space] * do(dom_id))) / S * V
+            return assemble_scalar(form(self.vout[space] * do(dom_id))) / Surf * V
diff --git a/nrv/fmod/FEM/fenics_utils/SimResult.py b/nrv/fmod/FEM/fenics_utils/SimResult.py
index d301d561..c831060b 100644
--- a/nrv/fmod/FEM/fenics_utils/SimResult.py
+++ b/nrv/fmod/FEM/fenics_utils/SimResult.py
@@ -13,9 +13,12 @@
 
 from ....backend.file_handler import rmv_ext
 from ....backend.log_interface import rise_error, rise_warning
-from ....backend.MCore import *
+from ....backend.MCore import MCH, synchronize_processes
 from ....backend.NRV_Class import NRV_class
-from ..mesh_creator.MshCreator import *
+from ..mesh_creator.MshCreator import (
+    is_MshCreator,
+    clear_gmsh,
+)
 
 
 ###############
@@ -65,26 +68,27 @@ def read_gmsh(mesh, comm=MPI.COMM_WORLD, rank=0, gdim=3):
         The MPI communicator to use for mesh creation
     rank            : tupple (str, int)
         The rank the Gmsh model is initialized on
+    gdim            : int
+        dimension of the mesh, by default 3
 
     Returns
     -------
     output  :  tuple(3)
         (domain, cell_tag, facet_tag)
     """
-    if comm.rank == rank:
-        if isinstance(mesh, str):
-            mesh_file = rmv_ext(mesh) + ".msh"
-            clear_gmsh()
-            gmsh.initialize()
-            gmsh.option.setNumber("General.Verbosity", 2)
-            gmsh.model.add("Mesh from file")
-            gmsh.merge(mesh_file)
-            output = model_to_mesh(gmsh.model, comm=comm, rank=rank, gdim=gdim)
-            gmsh.finalize()
-        elif is_MshCreator(mesh):
-            output = model_to_mesh(mesh.model, comm=comm, rank=rank, gdim=gdim)
-        else:
-            rise_error("mesh should be either a filename or a MeshCreator")
+    if isinstance(mesh, str):
+        mesh_file = rmv_ext(mesh) + ".msh"
+        clear_gmsh()
+        gmsh.initialize()
+        gmsh.option.setNumber("General.Verbosity", 2)
+        gmsh.model.add("Mesh from file")
+        gmsh.merge(mesh_file)
+        output = model_to_mesh(gmsh.model, comm=comm, rank=rank, gdim=gdim)
+        gmsh.finalize()
+    elif is_MshCreator(mesh):
+        output = model_to_mesh(mesh.model, comm=comm, rank=rank, gdim=gdim)
+    else:
+        rise_error("mesh should be either a filename or a MeshCreator")
     return output
 
 
@@ -242,36 +246,70 @@ def aline_V(self, res2):
         else:
             rise_error("Mesh function alinment must be done with SimResult")
 
-    def eval(self, X):
+    def eval(self, X, is_multi_proc=False):
         """
         Eval the result field at X position
         """
         N = len(X)
         to_round = False
+        cells = []
+        points_on_proc = []
         tree = BoundingBoxTree(self.domain, self.domain.geometry.dim)
+        # Find cells whose bounding-box collide with the the points
         cells_candidates = compute_collisions(tree, X)
+        # Choose one of the cells that contains the point
         cells_colliding = compute_colliding_cells(self.domain, cells_candidates, X)
-        cells = []
         for i in range(N):
             cell = cells_colliding.links(i)
-            if len(cell) == 0:
-                if i == N - 1 and i > 0:
-                    to_round = True
-                else:
-                    rise_warning(
-                        X[i], " not found in mesh, value of ", X[i - 1], " reused"
-                    )
-                cells += [cells[-1]]
+            if is_multi_proc:
+                if len(cell) > 0:
+                    points_on_proc.append(X[i])
+                    cells.append(cells_colliding.links(i)[0])
             else:
-                cells += [cell[0]]
+                if len(cell) == 0:
+                    if i == N - 1 and i > 0:
+                        to_round = True
+                    else:
+                        rise_warning(
+                            X[i], " not found in mesh, value of ", X[i - 1], " reused"
+                        )
+                    cells += [cells[-1]]
+                else:
+                    cells += [cell[0]]
 
-        values = self.vout.eval(X, cells)
-        if N > 1:
-            values = values[:, 0]
+        if is_multi_proc:
+            points_on_proc = np.array(points_on_proc, dtype=np.float64)
+            s_values = self.vout.eval(points_on_proc, cells)
+            if len(points_on_proc) > 0:
+                m_values = np.concatenate((points_on_proc.T, s_values.T)).T
+            else:
+                m_values = np.array([])
+            m_values = self.comm.gather(m_values.tolist(), root=0)
+            if MCH.do_master_only_work():
+                val = []
+                for i in range(len(m_values)):
+                    for j in range(len(m_values[i])):
+                        val += [m_values[i][j]]
+                val = np.array(val)
+                values = np.empty((N), dtype="float64")
+                for i, p in enumerate(X):
+                    i_p = np.where((np.isclose(val[:, :3], p)).all(axis=1))[0]
+                    if len(i_p > 0):
+                        values[i] = val[i_p[0], 3]
+                    else:
+                        values[i] = values[i - 1]
+            else:
+                values = np.empty((N), dtype="float64")
+            synchronize_processes()
+            self.comm.Bcast(values, root=0)
+        else:
+            values = self.vout.eval(X, cells)
+            if N > 1:
+                values = values[:, 0]
         if to_round:
             X_1 = X[-1]
             X_1[0] = round(X_1[0], 1)
-            value_1 = self.eval([X_1])
+            value_1 = self.eval([X_1], is_multi_proc=is_multi_proc)
             values[-1] = value_1[0]
         return values
 
diff --git a/nrv/fmod/FEM/fenics_utils/fenics_materials.py b/nrv/fmod/FEM/fenics_utils/fenics_materials.py
index bda574f9..dc5aab66 100644
--- a/nrv/fmod/FEM/fenics_utils/fenics_materials.py
+++ b/nrv/fmod/FEM/fenics_utils/fenics_materials.py
@@ -14,7 +14,7 @@
 from ....backend.file_handler import json_dump, rmv_ext
 from ....backend.log_interface import rise_warning
 from ....utils.nrv_function import nrv_interp
-from ...materials import *
+from ...materials import is_mat, load_material, material
 
 # enable faulthandler to ease "segmentation faults" debug
 faulthandler.enable()
@@ -56,7 +56,13 @@ def mat_from_interp(
     f_material  : str
         either material name if the material is in the NRV2 Librairy or path to the corresponding
         .mat material file
-    kwar
+    kwargs      : dict
+        interpolation k arguments (cf ....utils.nrv_function.nrv_interp)
+
+    Returns
+    -------
+    mat_obj     : fenics_material
+        Fenics material with conductivity function defined from the interpolation
     """
     sigma_func = nrv_interp(
         X,
@@ -85,6 +91,11 @@ def mat_from_csv(f_material, **kwargs):
     f_material  : str
         name of the .csv file
 
+    Returns
+    -------
+    mat_obj     : fenics_material
+        Fenics material with conductivity function defined from the interpolation from the
+        value of f_material file
     """
     fname = rmv_ext(f_material) + ".csv"
 
@@ -162,7 +173,7 @@ def __init__(self, mat=None):
             self.sigma_zz = mat.sigma_zz
 
     ## Save and Load mehtods
-    def save(self, save=False, fname="material.json"):
+    def save(self, save=False, fname="Fenics_model.json", blacklist=[], **kwargs):
         """
         Return material as dictionary and eventually save it as json file
 
@@ -178,14 +189,9 @@ def save(self, save=False, fname="material.json"):
         mat_dic : dict
             dictionary containing all information
         """
-        mat_dic = super().save()
-        mat_dic["is_func"] = self.is_func
-        mat_dic["sigma_func"] = self.sigma_func
-        mat_dic["elem"] = self.elem
-        mat_dic["UN"] = self.UN
-        if save:
-            json_dump(mat_dic, fname)
-        return mat_dic
+        bl = [i for i in blacklist]
+        bl += ["sigma_fen"]
+        return super().save(save=save, fname=fname, blacklist=bl, **kwargs)
 
     def save_fenics_material(self, save=False, fname="fenics_material.json"):
         rise_warning("save_fenics_material is a deprecated method use save")
diff --git a/nrv/fmod/FEM/mesh_creator/MshCreator.py b/nrv/fmod/FEM/mesh_creator/MshCreator.py
index 82f0bbf8..aaa0cf30 100644
--- a/nrv/fmod/FEM/mesh_creator/MshCreator.py
+++ b/nrv/fmod/FEM/mesh_creator/MshCreator.py
@@ -6,7 +6,6 @@
 
 from ....backend.file_handler import rmv_ext
 from ....backend.log_interface import pass_info, rise_error, rise_warning
-from ....backend.MCore import *
 from ....backend.NRV_Class import NRV_class
 from ....backend.parameters import parameters
 
@@ -629,7 +628,7 @@ def generate(self):
             self.model.mesh.generate(self.D)
             self.is_generated = True
 
-    def save(self, fname):
+    def save(self, fname, generate=True):
         """
         Save mesh in fname in ".msh"
 
@@ -638,11 +637,24 @@ def save(self, fname):
         fname    : str
             path and name of saving file. If ends with ".msh" only save in ".msh" file
         """
-        self.generate()
+        if generate == True:
+            self.generate()
         fname = rmv_ext(fname)
         gmsh.write(fname + ".msh")
         self.file = fname
 
+    def load(self, fname):
+        """
+        load mesh from ".msh" file
+        """
+        if ".msh" not in fname:
+            fname += ".msh"
+        if not os.path.isfile(fname):
+            rise_warning(fname + " not found: Mesh could not be loaded")
+        else:
+            gmsh.merge(fname)
+            self.file = fname
+
     def visualize(self, fname=None):
         if fname is None:
             self.generate()
diff --git a/nrv/fmod/FEM/mesh_creator/NerveMshCreator.py b/nrv/fmod/FEM/mesh_creator/NerveMshCreator.py
index 2cce95d3..2694c679 100644
--- a/nrv/fmod/FEM/mesh_creator/NerveMshCreator.py
+++ b/nrv/fmod/FEM/mesh_creator/NerveMshCreator.py
@@ -1,8 +1,11 @@
 from cmath import phase
+import numpy as np
 
+from ....backend.NRV_Class import NRV_class
 from ....backend.log_interface import rise_error, rise_warning
-from ....utils.units import *
-from .MshCreator import *
+from ....utils.units import mm
+from ....backend.file_handler import rmv_ext
+from .MshCreator import MshCreator, pi
 
 ENT_DOM_offset = {
     "Volume": 0,
@@ -127,6 +130,62 @@ def get_parameters(self):
         param["electrodes"] = self.electrodes
         return param
 
+    def save(
+        self,
+        fname="nervemshcreator.json",
+        save=True,
+        mshfname=None,
+        blacklist=[],
+        **kwargs,
+    ):
+        """
+        Return extracellular context as dictionary and eventually save it as json file
+        NB: caution, first argument is fname to match with MshCreator.save arguments
+
+        Parameters
+        ----------
+        save    : bool
+            if True, save in json files
+        fname   : str
+            Path and Name of the saving file, by default "extracel_context.json"
+
+        Returns
+        -------
+        context_dic : dict
+            dictionary containing all information
+        """
+        blacklist += [
+            "model",
+        ]
+        if self.is_generated and save:
+            if mshfname is None:
+                mshfname = rmv_ext(fname) + ".msh"
+            super().save(fname=mshfname, generate=False)
+        fname = rmv_ext(fname) + ".json"
+        return NRV_class.save(
+            self, save=save, fname=fname, blacklist=blacklist, **kwargs
+        )
+
+    def load(self, data, mshfname=None, blacklist={}, **kwargs):
+        """
+        Generic loading method for NRV class instance
+
+        Parameters
+        ----------
+        data : dict
+            Dictionary containing the NRV object
+        blacklist : dict, optional
+            Dictionary containing the keys to be excluded from the load
+        **kwargs : dict, optional
+            Additional arguments to be passed to the load method of the NRV object
+        """
+        NRV_class.load(self, data, **kwargs)
+        self.electrodes = {int(k): v for k, v in self.electrodes.items()}
+        self.fascicles = {int(k): v for k, v in self.fascicles.items()}
+        self.axons = {int(k): v for k, v in self.axons.items()}
+        if self.is_generated and self.file != "":
+            super().load(self.file)
+
     def compute_mesh(self):
         """
         Compute mesh geometry, domains and resolution and then generate the mesh
@@ -168,33 +227,34 @@ def compute_geo(self):
         Compute the mesh geometry
 
         """
-        if self.is_outer:
-            self.add_cylinder(0, self.y_c, self.z_c, self.L, self.Outer_D / 2)
-            if self.default_res["Outerbox_tresholded"]:
-                self.Ox = self.add_line((0, 0, 0), (self.L, 0, 0))
-        self.add_cylinder(0, self.y_c, self.z_c, self.L, self.Nerve_D / 2)
-        for i in self.fascicles:
-            fascicle = self.fascicles[i]
-            self.add_cylinder(
-                0, fascicle["y_c"], fascicle["z_c"], self.L, fascicle["D"] / 2
-            )
+        if not self.is_geo:
+            if self.is_outer:
+                self.add_cylinder(0, self.y_c, self.z_c, self.L, self.Outer_D / 2)
+                if self.default_res["Outerbox_tresholded"]:
+                    self.Ox = self.add_line((0, 0, 0), (self.L, 0, 0))
+            self.add_cylinder(0, self.y_c, self.z_c, self.L, self.Nerve_D / 2)
+            for i in self.fascicles:
+                fascicle = self.fascicles[i]
+                self.add_cylinder(
+                    0, fascicle["y_c"], fascicle["z_c"], self.L, fascicle["D"] / 2
+                )
 
-        for i in self.axons:
-            axon = self.axons[i]
-            self.add_cylinder(0, axon["y_c"], axon["z_c"], self.L, axon["D"] / 2)
-        for i in self.electrodes:
-            electrode = self.electrodes[i]
-            if "CUFF MP" in electrode["type"]:
-                self.add_CUFF_MP(ID=i, **electrode["kwargs"])
-            elif "CUFF MEA" in electrode["type"]:
-                self.add_CUFF_MEA(ID=i, **electrode["kwargs"])
-            elif "CUFF" in electrode["type"]:
-                self.add_CUFF(ID=i, **electrode["kwargs"])
-            elif "LIFE" in electrode["type"]:
-                self.add_LIFE(ID=i, **electrode["kwargs"])
-
-        self.fragment(verbose=False)
-        self.is_geo = True
+            for i in self.axons:
+                axon = self.axons[i]
+                self.add_cylinder(0, axon["y_c"], axon["z_c"], self.L, axon["D"] / 2)
+            for i in self.electrodes:
+                electrode = self.electrodes[i]
+                if "CUFF MP" in electrode["type"]:
+                    self.add_CUFF_MP(ID=i, **electrode["kwargs"])
+                elif "CUFF MEA" in electrode["type"]:
+                    self.add_CUFF_MEA(ID=i, **electrode["kwargs"])
+                elif "CUFF" in electrode["type"]:
+                    self.add_CUFF(ID=i, **electrode["kwargs"])
+                elif "LIFE" in electrode["type"]:
+                    self.add_LIFE(ID=i, **electrode["kwargs"])
+
+            self.fragment(verbose=False)
+            self.is_geo = True
 
     def reshape_outerBox(self, Outer_D=None, res="default", tresholded_res=None):
         """
@@ -386,7 +446,7 @@ def add_electrode(self, elec_type, ID=None, res="default", **kwargs):
     def compute_domains(self):
         if not self.is_geo:
             rise_error("compute geometry before domain")
-        else:
+        elif not self.is_dom:
             self.__link_entity_domains(2)
             self.__link_entity_domains(3)
             self.compute_entity_domain()
@@ -737,8 +797,8 @@ def compute_entity_domain(self):
 
     def compute_res(self):
         if not self.is_dom and self.is_geo:
-            rise_error("compute geometry before domain")
-        else:
+            rise_error("compute geometry and domain before resolution")
+        elif not self.is_refined:
             self.res = max(self.default_res.values())
             fields = []
 
@@ -1102,8 +1162,11 @@ def add_CUFF_MEA(
         if size is None:
             s = pi * self.Nerve_D * 4 / (5 * N)
             size = (s, s)
-        elif not isinstance(size, tuple):
+        elif not np.iterable(size):
             size = (size, size)
+        elif len(size) != 2:
+            size = (size[0], size[0])
+
         self.add_CUFF_MP(
             ID=ID,
             N=N,
diff --git a/nrv/fmod/electrodes.py b/nrv/fmod/electrodes.py
index 399273be..d8330eda 100644
--- a/nrv/fmod/electrodes.py
+++ b/nrv/fmod/electrodes.py
@@ -7,7 +7,7 @@
 
 import numpy as np
 
-from ..backend.file_handler import *
+from ..backend.file_handler import json_load
 from ..backend.log_interface import rise_error, rise_warning
 from ..backend.NRV_Class import NRV_class
 
diff --git a/nrv/fmod/extracellular.py b/nrv/fmod/extracellular.py
index 7c122b9a..1fdb7949 100644
--- a/nrv/fmod/extracellular.py
+++ b/nrv/fmod/extracellular.py
@@ -7,16 +7,15 @@
 
 import numpy as np
 
-from ..backend.file_handler import *
+from ..backend.file_handler import json_load
 from ..backend.log_interface import rise_error, rise_warning
-from ..backend.MCore import *
+from ..backend.MCore import MCH
 from ..backend.NRV_Class import NRV_class
-from .electrodes import *
-from .FEM.COMSOL_model import *
-from .FEM.FEM import *
-from .FEM.FENICS_model import *
-from .materials import *
-from .stimulus import *
+from .electrodes import is_analytical_electrode, is_FEM_electrode, check_electrodes_overlap
+from .FEM.COMSOL_model import COMSOL_model, COMSOL_Status
+from .FEM.FENICS_model import FENICS_model
+from .materials import load_material, is_mat
+from .stimulus import get_equal_timing_copies
 
 # enable faulthandler to ease "segmentation faults" debug
 faulthandler.enable()
@@ -339,6 +338,7 @@ def __init__(
         epi_mat="epineurium",
         ext_mat="saline",
         comsol=True,
+        Ncore=None,
     ):
         """
         Implement a FEM_based_stimulation object.
@@ -361,6 +361,7 @@ def __init__(
         self.model_fname = model_fname
         self.setup = False
         self.is_run = False
+        self.Ncore = Ncore
         ## get material properties and add to model
 
         if is_mat(endo_mat):
@@ -393,18 +394,18 @@ def __init__(
         self.comsol = comsol and not (model_fname is None)
         self.fenics = not self.comsol
         ## load model
-        if MCH.do_master_only_work():
-            if self.comsol:
-                self.model = COMSOL_model(self.model_fname)
+        if self.comsol:
+            if MCH.do_master_only_work():
+                self.model = COMSOL_model(self.model_fname, Ncore=self.Ncore)
             else:
-                self.model = FENICS_model()
+                # check that COMSOL is not turned OFF in order to continue
+                if not COMSOL_Status:
+                    rise_warning(
+                        "Slave process abort as axon is supposed to used a COMSOL FEM and COMSOL turned off",
+                        abort=True,
+                    )
         else:
-            # check that COMSOL is not turned OFF in order to continue
-            if not COMSOL_Status:
-                rise_warning(
-                    "Slave process abort as axon is supposed to used a COMSOL FEM and COMSOL turned off",
-                    abort=True,
-                )
+            self.model = FENICS_model(Ncore=self.Ncore)
 
     def __del__(self):
         if (
@@ -413,6 +414,17 @@ def __del__(self):
             self.model.close()
             del self.model
 
+    def set_Ncore(self, N):
+        """
+        Set the number of cores to use for the FEM
+
+        Parameters
+        ----------
+        N       : int
+            Number of cores to set
+        """
+        self.model.set_Ncore(N=N)
+
     ## Save and Load mehtods
 
     def save(self, save=False, fname="extracel_context.json", blacklist=[], **kwargs):
@@ -676,7 +688,7 @@ def run_model(self):
         """
         Set materials properties, build geometry and mesh if not already done and solve the FEM model all in one.
         """
-        if MCH.do_master_only_work():
+        if MCH.do_master_only_work() or self.model.is_multi_proc:
             if not self.setup:
                 self.setup_FEM()
             if not self.is_run:
@@ -698,8 +710,9 @@ def compute_electrodes_footprints(self, x, y, z, ID):
         ID          : int
             ID of the axon
         """
-        # test if the model is not solve and run simulation
-        if MCH.do_master_only_work():
+
+        if MCH.do_master_only_work() or (self.fenics and self.model.is_multi_proc):
+            # test if the model is not solve and run simulation
             if not self.model.is_computed:
                 self.run_model()
             # get all potentials
diff --git a/nrv/fmod/recording.py b/nrv/fmod/recording.py
index 2ddbc8da..ce18ce69 100644
--- a/nrv/fmod/recording.py
+++ b/nrv/fmod/recording.py
@@ -7,12 +7,11 @@
 
 import numpy as np
 
-from ..backend.file_handler import *
 from ..backend.log_interface import rise_error, rise_warning
-from ..backend.MCore import *
+from ..backend.MCore import MCH, synchronize_processes
 from ..backend.NRV_Class import NRV_class
-from ..utils.units import *
-from .materials import *
+from ..utils.units import cm, m
+from .materials import load_material
 
 # enable faulthandler to ease "segmentation faults" debug
 faulthandler.enable()
diff --git a/nrv/fmod/stimulus.py b/nrv/fmod/stimulus.py
index 0527d342..d40a6ddf 100644
--- a/nrv/fmod/stimulus.py
+++ b/nrv/fmod/stimulus.py
@@ -7,10 +7,8 @@
 
 import numpy as np
 
-from ..backend.file_handler import *
 from ..backend.log_interface import pass_info, rise_warning
 from ..backend.NRV_Class import NRV_class
-from ..utils.units import *
 
 # enable faulthandler to ease "segmentation faults" debug
 faulthandler.enable()
diff --git a/nrv/nmod/axons.py b/nrv/nmod/axons.py
index e8321ecb..db2945fa 100644
--- a/nrv/nmod/axons.py
+++ b/nrv/nmod/axons.py
@@ -222,6 +222,7 @@ def __init__(
         T=None,
         ID=0,
         threshold=-40,
+        **kwarks,
     ):
         """
         initialisation of the axon,
@@ -300,6 +301,9 @@ def __init__(
         self.x_rec = np.asarray([])
         self.rec = "all"
         self.node_index = None
+        ## required for generate_axon_from_results
+        if "diameter" in kwarks:
+            self.d = kwarks["diameter"]
 
     def __del__(self):
         for section in neuron.h.allsec():
@@ -634,12 +638,14 @@ def simulate(
         axon_sim["dt"] = self.dt
         axon_sim["tstop"] = self.t_sim
         # myelinated specific parameters
-        if self.myelinated == True:
+        if self.myelinated:
             axon_sim["rec"] = self.rec
             axon_sim["x_nodes"] = self.x_nodes
             axon_sim["sequence"] = self.axon_path_type
             axon_sim["index"] = self.axon_path_index
             axon_sim["rec_pos_list"] = self.rec_position_list
+        else:
+            axon_sim["Nrec"] = self.Nrec
         # saving intra-cellular stimulation parameters
         axon_sim["intra_stim_positions"] = self.intra_current_stim_positions
         axon_sim["intra_stim_starts"] = self.intra_current_stim_starts
@@ -850,12 +856,30 @@ def simulate(
                         axon_sim["g_na"] = g_na_ax
                         axon_sim["g_k"] = g_k_ax
                         axon_sim["g_l"] = g_l_ax
+                    elif self.model == "Tigerholm":
+                        (
+                            axon_sim["g_nav17"],
+                            axon_sim["g_nav18"],
+                            axon_sim["g_nav19"],
+                            axon_sim["g_kA"],
+                            axon_sim["g_kM"],
+                            axon_sim["g_kdr"],
+                            axon_sim["g_kna"],
+                            axon_sim["g_h"],
+                            axon_sim["g_naleak"],
+                            axon_sim["g_kleak"],
+                        ) = self.get_ionic_conductance()
                     else:
-                        rise_warning(
-                            "g_ions recorder not implemented for "
-                            + self.model
-                            + " model "
-                        )
+                        (
+                            axon_sim["g_naf"],
+                            axon_sim["g_nas"],
+                            axon_sim["g_kd"],
+                            axon_sim["g_ka"],
+                            axon_sim["g_kds"],
+                            axon_sim["g_kca"],
+                            axon_sim["g_can"],
+                            axon_sim["g_cat"],
+                        ) = self.get_ionic_conductance()
                 else:
                     if self.model == "MRG":
                         (
@@ -875,8 +899,8 @@ def simulate(
                             g_na_ax,
                             g_nap_ax,
                             g_k_ax,
-                            g_kf_ax,
                             g_l_ax,
+                            g_kf_ax,
                             g_q_ax,
                         ) = self.get_ionic_conductance()
                         axon_sim["g_na"] = g_na_ax
@@ -1242,7 +1266,10 @@ def get_membrane_current(self):
     def get_ionic_current(self):
         pass
 
-    def get_conductance(self):
+    def get_membrane_conductance(self):
+        pass
+
+    def get_membrane_capacitance(self):
         pass
 
     def get_particules_values(self):
diff --git a/nrv/nmod/fascicle_generator.py b/nrv/nmod/fascicle_generator.py
index 3e9ea614..262ca3ca 100644
--- a/nrv/nmod/fascicle_generator.py
+++ b/nrv/nmod/fascicle_generator.py
@@ -71,7 +71,8 @@ def load_stat(stat_name):
     if f_in_librairy in stat_library:
         stat_file = np.genfromtxt(dir_path + "/stats/" + f_in_librairy, delimiter=",")
     else:
-        stat_file = np.genfromtxt(dir_path + "/stats/" + f_in_librairy, delimiter=",")
+        # stat_file = np.genfromtxt(dir_path + "/stats/" + f_in_librairy, delimiter=",")
+        stat_file = np.genfromtxt(f_in_librairy, delimiter=",")
     diameters = stat_file[:, 0]
     presence = stat_file[:, 1]
     return diameters, presence
@@ -339,32 +340,22 @@ def create_axon_population(
         + " Unmyelinated"
     )
     # generate the myelinated axons
-    pass_info("... generating the myelinated axons diameters, this may take a while")
-    # M_diam_list = M_gen.rvs(1,size = M)
-    M_diam_list = []
-    max_diam_value = M_gen.b - 0.01 * (M_gen.b - M_gen.a)
-    for k in range(M):
-        progression_popup(k, M, begin_message="\t axon ", endl="\r")
-        prov_diam = M_gen.rvs(1, size=1)[0]
-        while prov_diam > max_diam_value:
-            # definitely non ideal, but rv_continuous has a tendency of generating diameters
-            # at the max value, this while prevent from such accumulation
-            prov_diam = M_gen.rvs(1, size=1)[0]
-        M_diam_list.append(prov_diam)
+    xspace1 = np.linspace(1, 20, num=500)
+    if len(M_popt) < 4:
+        data = one_Gamma(xspace1, *M_popt)
+    else:
+        data = two_Gamma(xspace1, *M_popt)
+    data = data / np.sum(data)
+    M_diam_list = np.random.choice(xspace1, M, p=data)
     M_type = np.ones(M)
+
     # generate the unmyelinated axons
-    pass_info("... generating the unmyelinated axons diameters, this may take a while")
-    U_diam_list = []
-    max_diam_value = U_gen.b - 0.01 * (U_gen.b - U_gen.a)
-    for k in range(U):
-        print("\t axon " + f"{k+1}" + "/" + str(U), end="\r")
-        prov_diam = U_gen.rvs(1, size=1)[0]
-        while prov_diam > max_diam_value:  # same as for myelinated...
-            prov_diam = U_gen.rvs(1, size=1)[0]
-        U_diam_list.append(prov_diam)
+    xspace1 = np.linspace(0.1, 3, num=500)
+    data = one_Gamma(xspace1, *U_popt)
+    data = data / np.sum(data)
+    U_diam_list = np.random.choice(xspace1, U, p=data)
     U_type = np.zeros(U)
-    # final shuffle between unmyelinated and myelinated
-    pass_info("... performing a shuffle on myelinated and unmyelinated axons")
+
     shuffle_mask = np.random.permutation(N)
     axons_diameters = np.concatenate((M_diam_list, U_diam_list))
     axons_type = np.concatenate((M_type, U_type))
diff --git a/nrv/nmod/fascicles.py b/nrv/nmod/fascicles.py
index 0ff499a3..c5138389 100644
--- a/nrv/nmod/fascicles.py
+++ b/nrv/nmod/fascicles.py
@@ -11,7 +11,7 @@
 
 from ..backend.file_handler import *
 from ..backend.log_interface import pass_info, rise_warning
-from ..backend.MCore import *
+from ..backend.MCore import MCH, synchronize_processes
 from ..backend.NRV_Class import NRV_class
 from ..fmod.extracellular import *
 from ..fmod.recording import *
@@ -1232,11 +1232,17 @@ def compute_electrodes_footprints(
             of the corresponding axon ID
         """
         footprints = {}
-        if MCH.do_master_only_work():
-            self.set_axons_parameters(**kwargs)
-            if is_FEM_extra_stim(self.extra_stim):
+        mp_computation = False
+        if is_FEM_extra_stim(self.extra_stim):
+            mp_computation = (
+                self.extra_stim.fenics and self.extra_stim.model.is_multi_proc
+            )
+
+            if MCH.do_master_only_work() or mp_computation:
                 self.extra_stim.run_model()
 
+        if MCH.do_master_only_work() or mp_computation:
+            self.set_axons_parameters(**kwargs)
             for k in range(len(self.axons_diameter)):
                 if self.axons_type[k] == 0:
                     axon = unmyelinated(
@@ -1263,11 +1269,13 @@ def compute_electrodes_footprints(
                 del axon
             if save_ftp_only:
                 json_dump(footprints, filename)
-
         else:
             pass
         synchronize_processes()
-        self.footprints = MCH.master_broadcasts_array_to_all(footprints)
+        if not mp_computation:
+            self.footprints = MCH.master_broadcasts_array_to_all(footprints)
+        else:
+            self.footprints = footprints
         self.is_footprinted = True
         return footprints
 
@@ -1282,6 +1290,144 @@ def get_electrodes_footprints_on_axons(
             save_ftp_only=save_ftp_only, filename=filename, **kwargs
         )
 
+    def __sim_axon(
+        self,
+        k,
+        folder_name="",
+        t_sim=2e1,
+        record_V_mem=True,
+        record_I_mem=False,
+        record_I_ions=False,
+        record_g_mem=False,
+        record_g_ions=False,
+        record_particles=False,
+        loaded_footprints=True,
+        save_V_mem=False,
+        save_path="",
+        verbose=False,
+        PostProc_Filtering=None,
+        postproc_script="default",
+        is_master_slave=False,
+        **kwargs,
+    ):
+        """
+        Internal use only simumlated one axon of the fascicle
+
+        Parameters
+        ----------
+        k       : int
+            ID of the axon to simulate
+        """
+        ## test axon axons_type[k]
+        assert self.axons_type[k] in [0, 1]
+        if self.axons_type[k] == 0:
+            axon = unmyelinated(
+                self.axons_y[k],
+                self.axons_z[k],
+                round(self.axons_diameter[k], 2),
+                self.L,
+                ID=k,
+                **self.unmyelinated_param,
+            )
+        else:
+            axon = myelinated(
+                self.axons_y[k],
+                self.axons_z[k],
+                round(self.axons_diameter[k], 2),
+                self.L,
+                ID=k,
+                **self.myelinated_param,
+            )
+        ## add extracellular stimulation
+        axon.attach_extracellular_stimulation(self.extra_stim)
+        ## add recording mechanism
+        if self.record:
+            axon.attach_extracellular_recorder(self.recorder)
+        # add intracellular stim
+        if self.N_intra > 0:
+            for j in range(self.N_intra):
+                if is_iterable(self.intra_stim_ON[j]):
+                    # in this case, the stimulation is possibly not for all axons
+                    if self.intra_stim_ON[j][k]:
+                        # then stimulation should apply, look for the parameters
+                        # get position
+                        if is_iterable(self.intra_stim_position[j]):
+                            position = self.intra_stim_position[j][k]
+                        else:
+                            position = self.intra_stim_position[j]
+                        # get t_start
+                        if is_iterable(self.intra_stim_t_start[j]):
+                            t_start = self.intra_stim_t_start[j][k]
+                        else:
+                            t_start = self.intra_stim_t_start[j]
+                        # get duration
+                        if is_iterable(self.intra_stim_duration[j]):
+                            duration = self.intra_stim_duration[j][k]
+                        else:
+                            duration = self.intra_stim_duration[j]
+                        # get amplitude
+                        if is_iterable(self.intra_stim_amplitude[j]):
+                            amplitude = self.intra_stim_amplitude[j][k]
+                        else:
+                            amplitude = self.intra_stim_amplitude[j]
+                        # APPLY INTRA CELLULAR STIMULATION
+                        axon.insert_I_Clamp(position, t_start, duration, amplitude)
+                else:
+                    # in this case , stimulate all axons
+                    if is_iterable(self.intra_stim_position[j]):
+                        position = self.intra_stim_position[j][k]
+                    else:
+                        position = self.intra_stim_position[j]
+                    # get t_start
+                    if is_iterable(self.intra_stim_t_start[j]):
+                        t_start = self.intra_stim_t_start[j][k]
+                    else:
+                        t_start = self.intra_stim_t_start[j]
+                    # get duration
+                    if is_iterable(self.intra_stim_duration[j]):
+                        duration = self.intra_stim_duration[j][k]
+                    else:
+                        duration = self.intra_stim_duration[j]
+                    # get amplitude
+                    if is_iterable(self.intra_stim_amplitude[j]):
+                        amplitude = self.intra_stim_amplitude[j][k]
+                    else:
+                        amplitude = self.intra_stim_amplitude[j]
+                    # APPLY INTRA CELLULAR STIMULATION
+                    axon.insert_I_Clamp(position, t_start, duration, amplitude)
+        if is_master_slave:
+            ## perform simulation
+            # loaded_footprints is suppose to be false
+            # Request to server instantiate in FEM_stimulation.compute_electrodes_footprints
+            # (called by axon.get_electrodes_footprints_on_axon)
+            axon.get_electrodes_footprints_on_axon()
+            axon_ftpt = None
+        else:
+            if loaded_footprints == True and self.is_footprinted:
+                axon_ftpt = True
+                if k in self.footprints:
+                    axon.footprints = self.footprints[k]
+                elif str(k) in self.footprints:
+                    axon.footprints = self.footprints[str(k)]
+                else:
+                    rise_warning("footprints not computed for axon " + str(k))
+                    axon_ftpt = False
+            else:
+                axon_ftpt = False
+
+        sim_results = axon.simulate(
+            t_sim=t_sim,
+            record_V_mem=record_V_mem,
+            record_I_mem=record_I_mem,
+            record_I_ions=record_I_ions,
+            record_g_mem=record_g_mem,
+            record_g_ions=record_g_ions,
+            record_particles=record_particles,
+            loaded_footprints=axon_ftpt,
+        )
+        del axon
+        return sim_results
+
     def simulate(
         self,
         t_sim=2e1,
@@ -1358,9 +1504,36 @@ def simulate(
         if loaded_footprints:
             kwargs["myelinated_nseg_per_sec"] = self.myelinated_param["Nseg_per_sec"]
             kwargs["unmyelinated_nseg"] = self.unmyelinated_param["Nseg_per_sec"]
-
         self.set_axons_parameters(**kwargs)
         self.processes_status = ["computing" for _ in range(MCH.size)]
+        # Check if FEM should be done in parallel and do it if required
+        mp_computation = False
+        if is_FEM_extra_stim(self.extra_stim):
+            mp_computation = (
+                self.extra_stim.fenics and self.extra_stim.model.is_multi_proc
+            )
+        if mp_computation and not loaded_footprints:
+            self.compute_electrodes_footprints()
+            loaded_footprints = True
+        # Generate simulation parameter dict
+        sim_parameters = {
+            "t_sim": t_sim,
+            "record_V_mem": record_V_mem,
+            "record_I_mem": record_I_mem,
+            "record_I_ions": record_I_ions,
+            "record_g_mem": record_g_mem,
+            "record_g_ions": record_g_ions,
+            "record_particles": record_particles,
+            "loaded_footprints": loaded_footprints,
+            "folder_name": folder_name,
+            "save_V_mem": save_V_mem,
+            "save_path": save_path,
+            "verbose": verbose,
+            "PostProc_Filtering": PostProc_Filtering,
+            "postproc_script": postproc_script,
+        }
+        for key in kwargs:
+            sim_parameters[key] = kwargs[key]
         # create ID for all axons
         axons_ID = np.arange(len(self.axons_diameter))
         # FEM STIMULATION IN PARALLEL: master computes FEM (only one COMSOL licence, other computes axons)
@@ -1369,12 +1542,16 @@ def simulate(
             and loaded_footprints == False
             and not is_analytical_extra_stim(self.extra_stim)
             and not MCH.is_alone()
+            and not mp_computation
         ):
+            is_master_slave = True
+            sim_parameters["is_master_slave"] = is_master_slave
             # master solves FEM model
             if MCH.do_master_only_work():
                 self.extra_stim.run_model()
             else:
-                pass
+                if self.extra_stim.fenics:
+                    self.extra_stim.run_model()
             # synchronize all process
             synchronize_processes()
             # split the job
@@ -1425,107 +1602,15 @@ def simulate(
                 ## SLAVES ##
                 try:
                     for k in this_core_mask:
-                        ## test axon axons_type[k]
-                        assert self.axons_type[k] in [0, 1]
-                        if self.axons_type[k] == 0:
-                            axon = unmyelinated(
-                                self.axons_y[k],
-                                self.axons_z[k],
-                                round(self.axons_diameter[k], 2),
-                                self.L,
-                                ID=k,
-                                **self.unmyelinated_param,
-                            )
-                        else:
-                            axon = myelinated(
-                                self.axons_y[k],
-                                self.axons_z[k],
-                                round(self.axons_diameter[k], 2),
-                                self.L,
-                                ID=k,
-                                **self.myelinated_param,
-                            )
-                        ## add extracellular stimulation
-                        axon.attach_extracellular_stimulation(self.extra_stim)
-                        ## add recording mechanism
-                        if self.record:
-                            axon.attach_extracellular_recorder(self.recorder)
-                        # add intracellular stim
-                        if self.N_intra > 0:
-                            for j in range(self.N_intra):
-                                if is_iterable(self.intra_stim_ON[j]):
-                                    # in this case, the stimulation is possibly not for all axons
-                                    if self.intra_stim_ON[j][k]:
-                                        # then stimulation should apply, look for the parameters
-                                        # get position
-                                        if is_iterable(self.intra_stim_position[j]):
-                                            position = self.intra_stim_position[j][k]
-                                        else:
-                                            position = self.intra_stim_position[j]
-                                        # get t_start
-                                        if is_iterable(self.intra_stim_t_start[j]):
-                                            t_start = self.intra_stim_t_start[j][k]
-                                        else:
-                                            t_start = self.intra_stim_t_start[j]
-                                        # get duration
-                                        if is_iterable(self.intra_stim_duration[j]):
-                                            duration = self.intra_stim_duration[j][k]
-                                        else:
-                                            duration = self.intra_stim_duration[j]
-                                        # get amplitude
-                                        if is_iterable(self.intra_stim_amplitude[j]):
-                                            amplitude = self.intra_stim_amplitude[j][k]
-                                        else:
-                                            amplitude = self.intra_stim_amplitude[j]
-                                        # APPLY INTRA CELLULAR STIMULATION
-                                        axon.insert_I_Clamp(
-                                            position, t_start, duration, amplitude
-                                        )
-                                else:
-                                    # in this case , stimulate all axons
-                                    if is_iterable(self.intra_stim_position[j]):
-                                        position = self.intra_stim_position[j][k]
-                                    else:
-                                        position = self.intra_stim_position[j]
-                                    # get t_start
-                                    if is_iterable(self.intra_stim_t_start[j]):
-                                        t_start = self.intra_stim_t_start[j][k]
-                                    else:
-                                        t_start = self.intra_stim_t_start[j]
-                                    # get duration
-                                    if is_iterable(self.intra_stim_duration[j]):
-                                        duration = self.intra_stim_duration[j][k]
-                                    else:
-                                        duration = self.intra_stim_duration[j]
-                                    # get amplitude
-                                    if is_iterable(self.intra_stim_amplitude[j]):
-                                        amplitude = self.intra_stim_amplitude[j][k]
-                                    else:
-                                        amplitude = self.intra_stim_amplitude[j]
-                                    # APPLY INTRA CELLULAR STIMULATION
-                                    axon.insert_I_Clamp(
-                                        position, t_start, duration, amplitude
-                                    )
-                        ## perform simulation
-                        # loaded_footprints is suppose to be false
-                        # Request to server instantiate in FEM_stimulation.compute_electrodes_footprints
-                        # (called by axon.get_electrodes_footprints_on_axon)
-                        axon.get_electrodes_footprints_on_axon()
-                        sim_results = axon.simulate(
-                            t_sim=t_sim,
-                            record_V_mem=record_V_mem,
-                            record_I_mem=record_I_mem,
-                            record_I_ions=record_I_ions,
-                            record_g_mem=record_g_mem,
-                            record_g_ions=record_g_ions,
-                            record_particles=record_particles,
-                        )
-                        del axon
-                        ## postprocessing and data reduction
+                        sim_results = self.__sim_axon(k, **sim_parameters)
+                        # postprocessing and data reduction
+                        # (cannot be added to __sim.axon beceause nrv would not be global anymore)
                         if postproc_script.lower() in OTF_PP_library:
-                            postproc_script = OTF_PP_path + postproc_script
+                            postproc_script = OTF_PP_path + postproc_script.lower()
                         elif postproc_script.lower() + ".py" in OTF_PP_library:
-                            postproc_script = OTF_PP_path + postproc_script + ".py"
+                            postproc_script = (
+                                OTF_PP_path + postproc_script.lower() + ".py"
+                            )
                         with open(postproc_script) as f:
                             code = compile(f.read(), postproc_script, "exec")
                             exec(code, globals(), locals())
@@ -1545,6 +1630,8 @@ def simulate(
                 self.recorder.gather_all_recordings(master_computed=False)
         ###### NO STIM OR ANALYTICAL STIM: all in parallel, OR FEM STIM NO PARALLEL
         else:
+            is_master_slave = False
+            sim_parameters["is_master_slave"] = is_master_slave
             ## split the job between Cores/Computation nodes
             this_core_mask = MCH.split_job_from_arrays(len(self.axons_diameter))
             ## perform simulations
@@ -1553,110 +1640,9 @@ def simulate(
             for k in this_core_mask:
                 if MCH.is_alone() and verbose:
                     pass_info("\t Axon " + f"{k+1}" + "/" + str(self.N), end="\r")
-                ## test axon axons_type[k]
-                assert self.axons_type[k] in [0, 1]
-                if self.axons_type[k] == 0:
-                    axon = unmyelinated(
-                        self.axons_y[k],
-                        self.axons_z[k],
-                        round(self.axons_diameter[k], 2),
-                        self.L,
-                        ID=k,
-                        **self.unmyelinated_param,
-                    )
-                else:
-                    axon = myelinated(
-                        self.axons_y[k],
-                        self.axons_z[k],
-                        round(self.axons_diameter[k], 2),
-                        self.L,
-                        ID=k,
-                        **self.myelinated_param,
-                    )
-                ## add extracellular stimulation
-                if self.extra_stim is not None:
-                    axon.attach_extracellular_stimulation(self.extra_stim)
-                ## add recording mechanism
-                if self.record:
-                    axon.attach_extracellular_recorder(self.recorder)
-                ## add intracellular stim
-                if self.N_intra > 0:
-                    for j in range(self.N_intra):
-                        if is_iterable(self.intra_stim_ON[j]):
-                            # in this case, the stimulation is possibly not for all axons
-                            if self.intra_stim_ON[j][k]:
-                                # then stimulation should apply, look for the parameters
-                                # get position
-                                if is_iterable(self.intra_stim_position[j]):
-                                    position = self.intra_stim_position[j][k]
-                                else:
-                                    position = self.intra_stim_position[j]
-                                # get t_start
-                                if is_iterable(self.intra_stim_t_start[j]):
-                                    t_start = self.intra_stim_t_start[j][k]
-                                else:
-                                    t_start = self.intra_stim_t_start[j]
-                                # get duration
-                                if is_iterable(self.intra_stim_duration[j]):
-                                    duration = self.intra_stim_duration[j][k]
-                                else:
-                                    duration = self.intra_stim_duration[j]
-                                # get amplitude
-                                if is_iterable(self.intra_stim_amplitude[j]):
-                                    amplitude = self.intra_stim_amplitude[j][k]
-                                else:
-                                    amplitude = self.intra_stim_amplitude[j]
-                                # APPLY INTRA CELLULAR STIMULATION
-                                axon.insert_I_Clamp(
-                                    position, t_start, duration, amplitude
-                                )
-                        else:
-                            # in this case , stimulate all axons
-                            if is_iterable(self.intra_stim_position[j]):
-                                position = self.intra_stim_position[j][k]
-                            else:
-                                position = self.intra_stim_position[j]
-                            # get t_start
-                            if is_iterable(self.intra_stim_t_start[j]):
-                                t_start = self.intra_stim_t_start[j][k]
-                            else:
-                                t_start = self.intra_stim_t_start[j]
-                            # get duration
-                            if is_iterable(self.intra_stim_duration[j]):
-                                duration = self.intra_stim_duration[j][k]
-                            else:
-                                duration = self.intra_stim_duration[j]
-                            # get amplitude
-                            if is_iterable(self.intra_stim_amplitude[j]):
-                                amplitude = self.intra_stim_amplitude[j][k]
-                            else:
-                                amplitude = self.intra_stim_amplitude[j]
-                            # APPLY INTRA CELLULAR STIMULATION
-                            axon.insert_I_Clamp(position, t_start, duration, amplitude)
-                ## perform simulation
-                if loaded_footprints == True and self.is_footprinted:
-                    axon_ftpt = True
-                    if k in self.footprints:
-                        axon.footprints = self.footprints[k]
-                    elif str(k) in self.footprints:
-                        axon.footprints = self.footprints[str(k)]
-                    else:
-                        rise_warning("footprints not computed for axon " + str(k))
-                        axon_ftpt = False
-                else:
-                    axon_ftpt = False
-                sim_results = axon.simulate(
-                    t_sim=t_sim,
-                    record_V_mem=record_V_mem,
-                    record_I_mem=record_I_mem,
-                    record_I_ions=record_I_ions,
-                    record_g_mem=record_g_mem,
-                    record_g_ions=record_g_ions,
-                    record_particles=record_particles,
-                    loaded_footprints=axon_ftpt,
-                )
-                del axon
-                ## postprocessing and data reduction
+                sim_results = self.__sim_axon(k, **sim_parameters)
+                # postprocessing and data reduction
+                # (cannot be added to __sim.axon beceause nrv would not be global anymore)
                 if postproc_script.lower() in OTF_PP_library:
                     postproc_script = OTF_PP_path + postproc_script.lower()
                 elif postproc_script.lower() + ".py" in OTF_PP_library:
diff --git a/nrv/nmod/myelinated.py b/nrv/nmod/myelinated.py
index 5919a931..b3375b77 100644
--- a/nrv/nmod/myelinated.py
+++ b/nrv/nmod/myelinated.py
@@ -144,6 +144,7 @@ def __init__(
         T=None,
         ID=0,
         threshold=-40,
+        **kwargs,
     ):
         """
         initialisation of a myelinted axon
@@ -219,6 +220,7 @@ def __init__(
             T=T,
             ID=ID,
             threshold=threshold,
+            **kwargs,
         )
         self.myelinated = True
         self.thin = False
@@ -997,7 +999,7 @@ def insert_V_Clamp(self, position, stimulus):
     ##############################
     ## Result recording methods ##
     ##############################
-    def _set_recorders_with_key(
+    def __set_recorders_with_key(
         self,
         reclist,
         key=None,
@@ -1086,7 +1088,7 @@ def _set_recorders_with_key(
                             rec = neuron.h.Vector([0])
                         reclist.append(rec)
 
-    def _get_recorders_from_list(self, reclist):
+    def __get_recorders_from_list(self, reclist):
         """
         Convert reclist in np.array To automate methods set_recorder. For internal use only.
         Parameters
@@ -1109,18 +1111,27 @@ def _get_recorders_from_list(self, reclist):
             val[k, :] = np.asarray(reclist[k])
         return val
 
-    def _get_var_from_mod(
-        self, key_node=None, key_MYSA=None, key_FLUT=None, key_STIN=None
+    def __get_var_from_mod(
+        self,
+        key=None,
+        single_mod=True,
+        key_node=None,
+        key_MYSA=None,
+        key_FLUT=None,
+        key_STIN=None,
     ):
         """
         return a column with value in every recording point of a constant from a mod. For internal use only.
         """
+        if single_mod:
+            key_node, key_MYSA, key_FLUT, key_STIN = key, key, key, key
+
         if self.rec == "nodes":
-            val = np.zeros((len(self.node), 1))
+            val = np.zeros(len(self.node))
             if key_node is not None:
-                val[:, 0] = getattr(self.node[0](0.5), key_node)[0]
+                val[:] = getattr(self.node[0](0.5), key_node)[0]
         else:
-            val = np.zeros((len(self.x_rec), 1))
+            val = np.zeros((len(self.x_rec)))
             i = -1
             for k in range(len(self.axon_path_type)):
                 sec_type = self.axon_path_type[k]
@@ -1129,53 +1140,49 @@ def _get_var_from_mod(
                     i += 1
                     if sec_type == "node":
                         if key_node is not None:
-                            val[i, 0] = getattr(
-                                self.node[sec_index](position), key_node
-                            )[0]
+                            v = getattr(self.node[sec_index](position), key_node)[0]
                     elif sec_type == "MYSA":
                         if key_MYSA is not None:
-                            val[i, 0] = getattr(
-                                self.MYSA[sec_index](position), key_MYSA
-                            )[0]
+                            v = getattr(self.MYSA[sec_index](position), key_MYSA)[0]
                     elif sec_type == "FLUT":
                         if key_FLUT is not None:
-                            val[i, 0] = getattr(
-                                self.FLUT[sec_index](position), key_FLUT
-                            )[0]
+                            v = getattr(self.FLUT[sec_index](position), key_FLUT)[0]
                     else:  # should be STIN
                         if key_STIN is not None:
-                            val[i, 0] = getattr(
-                                self.STIN[sec_index](position), key_STIN
-                            )[0]
+                            v = getattr(self.STIN[sec_index](position), key_STIN)[0]
+                    if isinstance(v, float):
+                        val[i] = v
+                    else:   # needed for xc, xg, xraxial (see if it can be simplify)
+                        val[i] = v[0]
         return val
 
     def set_membrane_voltage_recorders(self):
         """
         Prepare the membrane voltage recording. For internal use only.
         """
-        self.vreclist = neuron.h.List()
+        self.v_reclist = neuron.h.List()
         key = "_ref_v"
-        self._set_recorders_with_key(self.vreclist, key)
+        self.__set_recorders_with_key(self.v_reclist, key)
 
     def get_membrane_voltage(self):
         """
         get the membrane voltage at the end of simulation. For internal use only.
         """
-        return self._get_recorders_from_list(self.vreclist)
+        return self.__get_recorders_from_list(self.v_reclist)
 
     def set_membrane_current_recorders(self):
         """
         Prepare the membrane current recording. For internal use only.
         """
-        self.ireclist = neuron.h.List()
+        self.i_reclist = neuron.h.List()
         key = "_ref_i_membrane"
-        self._set_recorders_with_key(self.ireclist, key)
+        self.__set_recorders_with_key(self.i_reclist, key)
 
     def get_membrane_current(self):
         """
         get the membrane current at the end of simulation. For internal use only.
         """
-        return self._get_recorders_from_list(self.ireclist)
+        return self.__get_recorders_from_list(self.i_reclist)
 
     def set_ionic_current_recorders(self):
         """
@@ -1183,19 +1190,19 @@ def set_ionic_current_recorders(self):
         """
         if self.model == "MRG":
             self.ina_reclist = neuron.h.List()
-            self._set_recorders_with_key(
+            self.__set_recorders_with_key(
                 self.ina_reclist, single_mod=False, key_node="_ref_ina_axnode"
             )
             self.inap_reclist = neuron.h.List()
-            self._set_recorders_with_key(
+            self.__set_recorders_with_key(
                 self.inap_reclist, single_mod=False, key_node="_ref_inap_axnode"
             )
             self.ik_reclist = neuron.h.List()
-            self._set_recorders_with_key(
+            self.__set_recorders_with_key(
                 self.ik_reclist, single_mod=False, key_node="_ref_ik_axnode"
             )
             self.il_reclist = neuron.h.List()
-            self._set_recorders_with_key(
+            self.__set_recorders_with_key(
                 self.il_reclist, single_mod=False, key_node="_ref_il_axnode"
             )
         else:  # should be Gaines, motor or sensory
@@ -1204,17 +1211,17 @@ def set_ionic_current_recorders(self):
             else:
                 key_mod = "_sensory"
             self.ina_reclist = neuron.h.List()
-            self._set_recorders_with_key(
+            self.__set_recorders_with_key(
                 self.ina_reclist, single_mod=False, key_node="_ref_ina_node" + key_mod
             )
 
             self.inap_reclist = neuron.h.List()
-            self._set_recorders_with_key(
+            self.__set_recorders_with_key(
                 self.inap_reclist, single_mod=False, key_node="_ref_inap_node" + key_mod
             )
 
             self.ik_reclist = neuron.h.List()
-            self._set_recorders_with_key(
+            self.__set_recorders_with_key(
                 self.ik_reclist,
                 single_mod=False,
                 key_node="_ref_ik_node" + key_mod,
@@ -1224,7 +1231,7 @@ def set_ionic_current_recorders(self):
             )
 
             self.ikf_reclist = neuron.h.List()
-            self._set_recorders_with_key(
+            self.__set_recorders_with_key(
                 self.ikf_reclist,
                 single_mod=False,
                 key_node="_ref_ikf_node" + key_mod,
@@ -1234,7 +1241,7 @@ def set_ionic_current_recorders(self):
             )
 
             self.iq_reclist = neuron.h.List()
-            self._set_recorders_with_key(
+            self.__set_recorders_with_key(
                 self.iq_reclist,
                 single_mod=False,
                 key_MYSA="_ref_iq_mysa" + key_mod,
@@ -1243,7 +1250,7 @@ def set_ionic_current_recorders(self):
             )
 
             self.il_reclist = neuron.h.List()
-            self._set_recorders_with_key(
+            self.__set_recorders_with_key(
                 self.il_reclist,
                 single_mod=False,
                 key_node="_ref_il_node" + key_mod,
@@ -1257,13 +1264,13 @@ def get_ionic_current(self):
         get the ionic channels currents at the end of simulation. For internal use only.
         """
         results = []
-        results += [self._get_recorders_from_list(self.ina_reclist)]
-        results += [self._get_recorders_from_list(self.inap_reclist)]
-        results += [self._get_recorders_from_list(self.ik_reclist)]
+        results += [self.__get_recorders_from_list(self.ina_reclist)]
+        results += [self.__get_recorders_from_list(self.inap_reclist)]
+        results += [self.__get_recorders_from_list(self.ik_reclist)]
         if self.model == "Gaines_motor" or self.model == "Gaines_sensory":
-            results += [self._get_recorders_from_list(self.ikf_reclist)]
-            results += [self._get_recorders_from_list(self.iq_reclist)]
-        results += [self._get_recorders_from_list(self.il_reclist)]
+            results += [self.__get_recorders_from_list(self.ikf_reclist)]
+            results += [self.__get_recorders_from_list(self.iq_reclist)]
+        results += [self.__get_recorders_from_list(self.il_reclist)]
         return results
 
     def set_particules_values_recorders(self):
@@ -1271,21 +1278,21 @@ def set_particules_values_recorders(self):
         Prepare the particules current recording. For internal use only.
         """
         if self.model == "MRG":
-            self.mreclist = neuron.h.List()
-            self._set_recorders_with_key(
-                self.mreclist, single_mod=False, key_node="_ref_m_axnode"
+            self.m_reclist = neuron.h.List()
+            self.__set_recorders_with_key(
+                self.m_reclist, single_mod=False, key_node="_ref_m_axnode"
             )
-            self.mpreclist = neuron.h.List()
-            self._set_recorders_with_key(
-                self.mpreclist, single_mod=False, key_node="_ref_mp_axnode"
+            self.mp_reclist = neuron.h.List()
+            self.__set_recorders_with_key(
+                self.mp_reclist, single_mod=False, key_node="_ref_mp_axnode"
             )
-            self.hreclist = neuron.h.List()
-            self._set_recorders_with_key(
-                self.hreclist, single_mod=False, key_node="_ref_h_axnode"
+            self.h_reclist = neuron.h.List()
+            self.__set_recorders_with_key(
+                self.h_reclist, single_mod=False, key_node="_ref_h_axnode"
             )
-            self.sreclist = neuron.h.List()
-            self._set_recorders_with_key(
-                self.sreclist, single_mod=False, key_node="_ref_s_axnode"
+            self.s_reclist = neuron.h.List()
+            self.__set_recorders_with_key(
+                self.s_reclist, single_mod=False, key_node="_ref_s_axnode"
             )
 
         else:  # should be Gaines, motor or sensory
@@ -1294,24 +1301,24 @@ def set_particules_values_recorders(self):
             else:
                 key_mod = "_sensory"
 
-            self.mreclist = neuron.h.List()
-            self._set_recorders_with_key(
-                self.mreclist, single_mod=False, key_node="_ref_m_node" + key_mod
+            self.m_reclist = neuron.h.List()
+            self.__set_recorders_with_key(
+                self.m_reclist, single_mod=False, key_node="_ref_m_node" + key_mod
             )
 
-            self.mpreclist = neuron.h.List()
-            self._set_recorders_with_key(
-                self.mpreclist, single_mod=False, key_node="_ref_mp_node" + key_mod
+            self.mp_reclist = neuron.h.List()
+            self.__set_recorders_with_key(
+                self.mp_reclist, single_mod=False, key_node="_ref_mp_node" + key_mod
             )
 
-            self.hreclist = neuron.h.List()
-            self._set_recorders_with_key(
-                self.hreclist, single_mod=False, key_node="_ref_h_node" + key_mod
+            self.h_reclist = neuron.h.List()
+            self.__set_recorders_with_key(
+                self.h_reclist, single_mod=False, key_node="_ref_h_node" + key_mod
             )
 
-            self.sreclist = neuron.h.List()
-            self._set_recorders_with_key(
-                self.sreclist,
+            self.s_reclist = neuron.h.List()
+            self.__set_recorders_with_key(
+                self.s_reclist,
                 single_mod=False,
                 key_node="_ref_s_node" + key_mod,
                 key_MYSA="_ref_s_mysa" + key_mod,
@@ -1319,9 +1326,9 @@ def set_particules_values_recorders(self):
                 key_STIN="_ref_s_stin" + key_mod,
             )
 
-            self.nreclist = neuron.h.List()
-            self._set_recorders_with_key(
-                self.nreclist,
+            self.n_reclist = neuron.h.List()
+            self.__set_recorders_with_key(
+                self.n_reclist,
                 single_mod=False,
                 key_node="_ref_n_node" + key_mod,
                 key_MYSA="_ref_n_mysa" + key_mod,
@@ -1329,9 +1336,9 @@ def set_particules_values_recorders(self):
                 key_STIN="_ref_n_stin" + key_mod,
             )
 
-            self.qreclist = neuron.h.List()
-            self._set_recorders_with_key(
-                self.qreclist,
+            self.q_reclist = neuron.h.List()
+            self.__set_recorders_with_key(
+                self.q_reclist,
                 single_mod=False,
                 key_MYSA="_ref_q_mysa" + key_mod,
                 key_FLUT="_ref_q_flut" + key_mod,
@@ -1343,83 +1350,115 @@ def get_particles_values(self):
         get the particules values at the end of simulation. For internal use only.
         """
         results = []
-        results += [self._get_recorders_from_list(self.mreclist)]
-        results += [self._get_recorders_from_list(self.mpreclist)]
-        results += [self._get_recorders_from_list(self.hreclist)]
-        results += [self._get_recorders_from_list(self.sreclist)]
+        results += [self.__get_recorders_from_list(self.m_reclist)]
+        results += [self.__get_recorders_from_list(self.mp_reclist)]
+        results += [self.__get_recorders_from_list(self.h_reclist)]
+        results += [self.__get_recorders_from_list(self.s_reclist)]
         if self.model == "Gaines_motor" or self.model == "Gaines_sensory":
-            results += [self._get_recorders_from_list(self.nreclist)]
-            results += [self._get_recorders_from_list(self.qreclist)]
+            results += [self.__get_recorders_from_list(self.n_reclist)]
+            results += [self.__get_recorders_from_list(self.q_reclist)]
         return results
 
     def set_conductance_recorders(self):
         """
         Prepare the ionic channels conductance recording. For internal use only.
         """
-        self.set_particules_values_recorders()
-
-    def get_ionic_conductance(self):
-        """
-        get the ionic channels conductance at the end of simulation. For internal use only.
-        """
+        self.gna_reclist = neuron.h.List()
+        self.gnap_reclist = neuron.h.List()
+        self.gk_reclist = neuron.h.List()
+        self.gl_reclist = neuron.h.List()
         if self.model == "MRG":
-            m_ax, mp_ax, h_ax, s_ax = self.get_particles_values()
-            gnabar = self._get_var_from_mod(key_node="_ref_gnabar_axnode")
-            gnapbar = self._get_var_from_mod(key_node="_ref_gnapbar_axnode")
-            gkbar = self._get_var_from_mod(key_node="_ref_gkbar_axnode")
-            glbar = self._get_var_from_mod(key_node="_ref_gl_axnode")
-            gibar = self._get_var_from_mod(
-                key_MYSA="_ref_g_pas", key_FLUT="_ref_g_pas", key_STIN="_ref_g_pas"
+            self.__set_recorders_with_key(
+                self.gna_reclist, single_mod=False, key_node="_ref_gna_axnode"
             )
-            g_na_ax = gnabar * m_ax**3 * h_ax
-            g_nap_ax = gnapbar * mp_ax**3
-            g_k_ax = gkbar * s_ax
-            g_l_ax = glbar * np.ones((len(glbar), self.t_len))
-            g_i_ax = gibar * np.ones((len(gibar), self.t_len))
-
-            results = [g_na_ax, g_nap_ax, g_k_ax, g_l_ax, g_i_ax]
-        else:  # should be Gaines, motor or sensory
-            m_ax, mp_ax, h_ax, s_ax, n_ax, q_ax = self.get_particles_values()
-
+            self.__set_recorders_with_key(
+                self.gnap_reclist, single_mod=False, key_node="_ref_gnap_axnode"
+            )
+            self.__set_recorders_with_key(
+                self.gk_reclist, single_mod=False, key_node="_ref_gk_axnode"
+            )
+            self.__set_recorders_with_key(
+                self.gl_reclist, single_mod=False, key_node="_ref_gl_axnode"
+            )
+            if not self.rec == "nodes":
+                self.gi_reclist = neuron.h.List()
+                self.__set_recorders_with_key(
+                    self.gi_reclist,
+                    single_mod=False,
+                    key_MYSA="_ref_g_pas",
+                    key_FLUT="_ref_g_pas",
+                    key_STIN="_ref_g_pas",
+                )
+        else:  # should be Gaines motor or sensory
+            self.gkf_reclist = neuron.h.List()
+            self.gq_reclist = neuron.h.List()
             if self.model == "Gaines_motor":
                 key_mod = "_motor"
             else:
                 key_mod = "_sensory"
-
-            gnabar = self._get_var_from_mod(key_node="_ref_gnabar_node" + key_mod)
-            gnapbar = self._get_var_from_mod(key_node="_ref_gnapbar_node" + key_mod)
-            gkbar = self._get_var_from_mod(
-                key_node="_ref_gkbar_node" + key_mod,
-                key_MYSA="_ref_gkbar_mysa" + key_mod,
-                key_FLUT="_ref_gkbar_flut" + key_mod,
-                key_STIN="_ref_gkbar_stin" + key_mod,
+            self.__set_recorders_with_key(
+                self.gna_reclist,
+                single_mod=False,
+                key_node="_ref_gna_node" + key_mod,
             )
-            gkfbar = self._get_var_from_mod(
-                key_node="_ref_gkf_node" + key_mod,
-                key_MYSA="_ref_gkf_mysa" + key_mod,
-                key_FLUT="_ref_gkf_flut" + key_mod,
-                key_STIN="_ref_gkf_stin" + key_mod,
+            self.__set_recorders_with_key(
+                self.gnap_reclist,
+                single_mod=False,
+                key_node="_ref_gnap_node" + key_mod,
             )
-            glbar = self._get_var_from_mod(
+            self.__set_recorders_with_key(
+                self.gk_reclist,
+                single_mod=False,
+                key_node="_ref_gk_node" + key_mod,
+                key_MYSA="_ref_gk_mysa" + key_mod,
+                key_FLUT="_ref_gk_flut" + key_mod,
+                key_STIN="_ref_gk_stin" + key_mod,
+            )
+            self.__set_recorders_with_key(
+                self.gl_reclist,
+                single_mod=False,
                 key_node="_ref_gl_node" + key_mod,
                 key_MYSA="_ref_gl_mysa" + key_mod,
                 key_FLUT="_ref_gl_flut" + key_mod,
                 key_STIN="_ref_gl_stin" + key_mod,
             )
-            gqbar = self._get_var_from_mod(
-                key_MYSA="_ref_gq_mysa" + key_mod,
-                key_FLUT="_ref_gq_flut" + key_mod,
-                key_STIN="_ref_gq_stin" + key_mod,
+            self.__set_recorders_with_key(
+                self.gkf_reclist,
+                single_mod=False,
+                key_node="_ref_gkf_node" + key_mod,
+                key_MYSA="_ref_gkf_mysa" + key_mod,
+                key_FLUT="_ref_gkf_flut" + key_mod,
+                key_STIN="_ref_gkf_stin" + key_mod,
             )
+            if not self.rec == "nodes":
+                self.__set_recorders_with_key(
+                    self.gq_reclist,
+                    single_mod=False,
+                    key_MYSA="_ref_gq_mysa" + key_mod,
+                    key_FLUT="_ref_gq_flut" + key_mod,
+                    key_STIN="_ref_gq_stin" + key_mod,
+                )
 
-            g_na_ax = gnabar * m_ax**3 * h_ax
-            g_nap_ax = gnapbar * mp_ax**3
-            g_k_ax = gkbar * s_ax
-            g_kf_ax = gkfbar * n_ax**3
-            g_l_ax = glbar * np.ones((len(glbar), self.t_len))
-            g_q_ax = gqbar * q_ax
-
-            results = [g_na_ax, g_nap_ax, g_k_ax, g_kf_ax, g_l_ax, g_q_ax]
+    def get_ionic_conductance(self):
+        """
+        get the ionic channels conductance at the end of simulation. For internal use only.
+        """
+        results = []
+        results += [self.__get_recorders_from_list(self.gna_reclist)]
+        results += [self.__get_recorders_from_list(self.gnap_reclist)]
+        results += [self.__get_recorders_from_list(self.gk_reclist)]
+        results += [self.__get_recorders_from_list(self.gl_reclist)]
+        if self.model == "MRG":
+            if self.rec == "nodes":
+                results += [np.zeros((self.axonnodes, self.t_len))]
+            else:
+                results += [self.__get_recorders_from_list(self.gi_reclist)]
+        else:  # should be Gaines, motor or sensory
+            results += [self.__get_recorders_from_list(self.gkf_reclist)]
+            if self.rec == "nodes":
+                results += [np.zeros((self.axonnodes, self.t_len))]
+            else:
+                results += [self.__get_recorders_from_list(self.gq_reclist)]
         return results
 
     def get_membrane_conductance(self):
@@ -1428,6 +1467,27 @@ def get_membrane_conductance(self):
         """
         return sum(self.get_ionic_conductance())
 
+    def get_membrane_capacitance(self):
+        """
+        get the membrane capacitance
+        NB: [uF/cm^{2}] (see Neuron unit)
+        """
+        return self.__get_var_from_mod("_ref_cm")
+
+    def get_myeline_conductance(self):
+        """
+        get the membrane capacitance
+        NB: [S/cm^{2}] (see Neuron unit)
+        """
+        return self.__get_var_from_mod("_ref_xg")
+
+    def get_myeline_capacitance(self):
+        """
+        get the membrane capacitance
+        NB: [uF/cm^{2}] (see Neuron unit)
+        """
+        return self.__get_var_from_mod("_ref_xc")
+
     def set_Nav_recorders(self):
         """
         Prepare the markov model recording. For internal use only.
diff --git a/nrv/nmod/nerve.py b/nrv/nmod/nerve.py
index c51a2440..d5bd13c9 100644
--- a/nrv/nmod/nerve.py
+++ b/nrv/nmod/nerve.py
@@ -7,6 +7,7 @@
 
 from ..backend.log_interface import pass_info, rise_warning
 from ..backend.NRV_Class import NRV_class, load_any
+from ..fmod.stimulus import stimulus
 from .fascicles import *
 
 
@@ -564,7 +565,6 @@ def plot(
                 )
 
     ## Context handeling methods
-
     def clear_context(
         self, extracel_context=True, intracel_context=True, rec_context=True
     ):
@@ -717,12 +717,15 @@ def compute_electrodes_footprints(self, **kwargs):
             self.set_axons_parameters(**kwargs)
 
             if self.is_extra_stim:
-                if MCH.do_master_only_work() and is_FEM_extra_stim(self.extra_stim):
-                    self.extra_stim.run_model()
+                mp_computation = False
+                if is_FEM_extra_stim(self.extra_stim):
+                    mp_computation = (
+                        self.extra_stim.fenics and self.extra_stim.model.is_multi_proc
+                    )
+                    if MCH.do_master_only_work() or mp_computation:
+                        self.extra_stim.run_model()
                 for fasc in self.fascicles.values():
                     fasc.compute_electrodes_footprints()
-                if MCH.do_master_only_work() and is_FEM_extra_stim(self.extra_stim):
-                    del self.extra_stim.model
             self.is_footprinted = True
 
     ## SIMULATION
@@ -777,5 +780,6 @@ def simulate(
                 save_path=folder_name,
                 postproc_script=postproc_script,
                 in_nerve=True,
+                **kwargs,
             )
         self.is_simulated = True
diff --git a/nrv/nmod/unmyelinated.py b/nrv/nmod/unmyelinated.py
index 65f6d3bc..def68361 100644
--- a/nrv/nmod/unmyelinated.py
+++ b/nrv/nmod/unmyelinated.py
@@ -36,6 +36,7 @@ def __init__(
         T=None,
         ID=0,
         threshold=-40,
+        **kwarks,
     ):
         """
         initialisation of an unmyelinted axon
@@ -110,6 +111,7 @@ def __init__(
             T=T,
             ID=ID,
             threshold=threshold,
+            **kwarks,
         )
         self.Nsec = Nsec
         self.Nrec = Nrec
@@ -522,49 +524,87 @@ def insert_V_Clamp(self, position, stimulus):
     ##############################
     ## Result recording methods ##
     ##############################
+    def __set_recorders_with_key(self, *args):
+        """
+        To automate the methods set_recorder. For internal use only.
+        Parameters
+        ----------
+        *args    : list(tuple)
+            list of tuple containing a rec list to set and the corresonding key to access
+            NB: keys should be str such as "_ref_xxx_yyy" where xxx is the variable to access
+            and yyy the .mod file suffix if the variable is in one
+        """
+        for k in range(self.Nsec):
+            for pos in self.rec_position_list[k]:
+                for t in args:
+                    key = t[1]
+                    # print(dir(self.unmyelinated_sections[k](pos)))
+                    # print(key, getattr(self.unmyelinated_sections[k](pos),key))
+                    rec = neuron.h.Vector().record(
+                        getattr(self.unmyelinated_sections[k](pos), key),
+                        sec=self.unmyelinated_sections[k],
+                    )
+                    t[0].append(rec)
+
+    def __get_var_from_mod(
+        self, key
+    ):
+        """
+        return a column with value in every recording point of a constant from a mod. For internal use only.
+        """
+        val = np.zeros((len(self.x_rec)))
+        i = 0
+        for k in range(self.Nsec):
+            for pos in self.rec_position_list[k]:
+                #print(getattr(self.unmyelinated_sections[k](pos), key)[0])
+                val[i] = getattr(self.unmyelinated_sections[k](pos), key)[0]
+                i += 1
+        return val
+
+    def __get_recorders_from_list(self, reclist):
+        """
+        Convert reclist in np.array To automate methods set_recorder. For internal use only.
+        Parameters
+        ----------
+        reclist     : neuron.h.List
+            List in witch the reccorders are saved
+
+        Returns
+        -------
+        val         : np.array
+            array of every recorded value for all rec point and time
+        """
+        dim = (self.Nrec, self.t_len)
+        val = np.zeros(dim)
+        for k in range(dim[0]):
+            val[k, :] = np.asarray(reclist[k])
+        return val
+
     def set_membrane_voltage_recorders(self):
         """
         Prepare the membrane voltage recording. For internal use only.
         """
         self.vreclist = neuron.h.List()
-        for k in range(self.Nsec):
-            for pos in self.rec_position_list[k]:
-                vrec = neuron.h.Vector().record(
-                    self.unmyelinated_sections[k](pos)._ref_v,
-                    sec=self.unmyelinated_sections[k],
-                )
-                self.vreclist.append(vrec)
+        self.__set_recorders_with_key((self.vreclist, "_ref_v"))
 
     def get_membrane_voltage(self):
         """
         get the membrane voltage at the end of simulation. For internal use only.
         """
-        vax = np.zeros((self.Nrec, self.t_len))
-        for k in range(self.Nrec):
-            vax[k, :] = np.asarray(self.vreclist[k])
-        return vax
+        return self.__get_recorders_from_list(self.vreclist)
 
     def set_membrane_current_recorders(self):
         """
         Prepare the membrane current recording. For internal use only.
         """
         self.ireclist = neuron.h.List()
-        for k in range(self.Nsec):
-            for pos in self.rec_position_list[k]:
-                i_mem_rec = neuron.h.Vector().record(
-                    self.unmyelinated_sections[k](pos)._ref_i_membrane,
-                    sec=self.unmyelinated_sections[k],
-                )
-                self.ireclist.append(i_mem_rec)
+        self.__set_recorders_with_key((self.ireclist, "_ref_i_membrane"))
 
     def get_membrane_current(self):
         """
         get the membrane current at the end of simulation. For internal use only.
         """
-        iax = np.zeros((self.Nrec, self.t_len))
-        for k in range(self.Nrec):
-            iax[k, :] = np.asarray(self.ireclist[k])
-        return iax
+        return self.__get_recorders_from_list(self.ireclist)
 
     def set_ionic_current_recorders(self):
         """
@@ -574,217 +614,179 @@ def set_ionic_current_recorders(self):
             self.i_na_reclist = neuron.h.List()
             self.i_k_reclist = neuron.h.List()
             self.i_l_reclist = neuron.h.List()
-            for k in range(self.Nsec):
-                for pos in self.rec_position_list[k]:
-                    i_na_rec = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_nai,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    i_k_rec = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_ki,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    i_l_rec = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_i_pas,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    self.i_na_reclist.append(i_na_rec)
-                    self.i_k_reclist.append(i_k_rec)
-                    self.i_l_reclist.append(i_l_rec)
+            self.__set_recorders_with_key(
+                (self.i_na_reclist, "_ref_nai"),
+                (self.i_k_reclist, "_ref_ki"),
+                (self.i_l_reclist, "_ref_i_pas"),
+            )
         else:
             self.i_na_reclist = neuron.h.List()
             self.i_k_reclist = neuron.h.List()
             self.i_ca_reclist = neuron.h.List()
-            self.i_l_reclist = neuron.h.List()
-            for k in range(self.Nsec):
-                for pos in self.rec_position_list[k]:
-                    i_na_rec = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_nai,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    i_k_rec = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_ki,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    i_ca_rec = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_cai,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    self.i_na_reclist.append(i_na_rec)
-                    self.i_k_reclist.append(i_k_rec)
-                    self.i_ca_reclist.append(i_ca_rec)
+            self.__set_recorders_with_key(
+                (self.i_na_reclist, "_ref_nai"),
+                (self.i_k_reclist, "_ref_ki"),
+                (self.i_ca_reclist, "_ref_cai"),
+            )
 
     def get_ionic_current(self):
         """
         get the ionic currents at the end of simulation. For internal use only.
         """
+        results = []
+        results += [self.__get_recorders_from_list(self.i_na_reclist)]
+        results += [self.__get_recorders_from_list(self.i_k_reclist)]
         if self.model in ["HH", "Rattay_Aberham", "Sundt"]:
-            i_na_ax = np.zeros((self.Nrec, self.t_len))
-            i_k_ax = np.zeros((self.Nrec, self.t_len))
-            i_l_ax = np.zeros((self.Nrec, self.t_len))
-            for k in range(self.Nrec):
-                i_na_ax[k, :] = np.asarray(self.i_na_reclist[k])
-                i_k_ax[k, :] = np.asarray(self.i_k_reclist[k])
-                i_l_ax[k, :] = np.asarray(self.i_l_reclist[k])
-            results = [i_na_ax, i_k_ax, i_l_ax]
+            results += [self.__get_recorders_from_list(self.i_l_reclist)]
         else:
-            i_na_ax = np.zeros((self.Nrec, self.t_len))
-            i_k_ax = np.zeros((self.Nrec, self.t_len))
-            i_ca_ax = np.zeros((self.Nrec, self.t_len))
-            for k in range(self.Nrec):
-                i_na_ax[k, :] = np.asarray(self.i_na_reclist[k])
-                i_k_ax[k, :] = np.asarray(self.i_k_reclist[k])
-                i_ca_ax[k, :] = np.asarray(self.i_ca_reclist[k])
-            results = [i_na_ax, i_k_ax, i_ca_ax]
+            results += [self.__get_recorders_from_list(self.i_ca_reclist)]
         return results
 
     def set_conductance_recorders(self):
         """
-        Prepare the membrane voltage recording. For internal use only.
+        Prepare the membrane conductance recording. For internal use only.
         """
-        if self.model == "HH":
-            self.g_na_reclist = neuron.h.List()
-            self.g_k_reclist = neuron.h.List()
-            self.g_l_reclist = neuron.h.List()
-            for k in range(self.Nsec):
-                for pos in self.rec_position_list[k]:
-                    g_na_rec = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_gna_hh,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    g_k_rec = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_gk_hh,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    g_l_rec = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_gl_hh,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    self.g_na_reclist.append(g_na_rec)
-                    self.g_k_reclist.append(g_k_rec)
-                    self.g_l_reclist.append(g_l_rec)
-        elif self.model == "Rattay_Aberham":
+        if self.model in ["HH", "Rattay_Aberham", "Sundt"]:
             self.g_na_reclist = neuron.h.List()
             self.g_k_reclist = neuron.h.List()
             self.g_l_reclist = neuron.h.List()
-            for k in range(self.Nsec):
-                for pos in self.rec_position_list[k]:
-                    g_na_rec = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_gna_RattayAberham,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    g_k_rec = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_gk_RattayAberham,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    g_l_rec = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_gl_RattayAberham,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    self.g_na_reclist.append(g_na_rec)
-                    self.g_k_reclist.append(g_k_rec)
-                    self.g_l_reclist.append(g_l_rec)
+            if self.model == "HH":
+                self.__set_recorders_with_key(
+                    (self.g_na_reclist, "_ref_gna_hh"),
+                    (self.g_k_reclist, "_ref_gk_hh"),
+                    (self.g_l_reclist, "_ref_gl_hh"),
+                )
+            elif self.model == "Rattay_Aberham":
+                self.__set_recorders_with_key(
+                    (self.g_na_reclist, "_ref_gna_RattayAberham"),
+                    (self.g_k_reclist, "_ref_gk_RattayAberham"),
+                    (self.g_l_reclist, "_ref_gl_RattayAberham"),
+                )
+            else:
+                self.__set_recorders_with_key(
+                    (self.g_na_reclist, "_ref_gna_nahh"),
+                    (self.g_k_reclist, "_ref_gkdr_borgkdr"),
+                    (self.g_l_reclist, "_ref_g_pas"),
+                )
+        elif self.model == "Tigerholm":
+            self.g_nav17_reclist = neuron.h.List()
+            self.g_nav18_reclist = neuron.h.List()
+            self.g_nav19_reclist = neuron.h.List()
+            self.g_kA_reclist = neuron.h.List()
+            self.g_kM_reclist = neuron.h.List()
+            self.g_kdr_reclist = neuron.h.List()
+            self.g_kna_reclist = neuron.h.List()
+            self.g_h_reclist = neuron.h.List()
+            self.g_naleak_reclist = neuron.h.List()
+            self.g_kleak_reclist = neuron.h.List()
+            self.__set_recorders_with_key(
+                (self.g_nav17_reclist, "_ref_g_nattxs"),
+                (self.g_nav18_reclist, "_ref_g_nav1p8"),
+                (self.g_nav19_reclist, "_ref_g_nav1p9"),
+                (self.g_kA_reclist, "_ref_g_ks"),
+                (self.g_kM_reclist, "_ref_g_kf"),
+                (self.g_kdr_reclist, "_ref_g_kdrTiger"),
+                (self.g_kna_reclist, "_ref_g_kna"),
+                (self.g_h_reclist, "_ref_g_h"),
+                (self.g_naleak_reclist, "_ref_gnaleak_leak"),
+                (self.g_kleak_reclist, "_ref_gkleak_leak"),
+            )
         else:
-            pass
+            self.g_naf_reclist = neuron.h.List()
+            self.g_nas_reclist = neuron.h.List()
+            self.g_kd_reclist = neuron.h.List()
+            self.g_ka_reclist = neuron.h.List()
+            self.g_kds_reclist = neuron.h.List()
+            self.g_kca_reclist = neuron.h.List()
+            self.g_can_reclist = neuron.h.List()
+            self.g_cat_reclist = neuron.h.List()
+            sup_key = ""
+            if self.model == "Schild_97":
+                sup_key = "97mean"
+            self.__set_recorders_with_key(
+                (self.g_naf_reclist, "_ref_g_naf" + sup_key),
+                (self.g_nas_reclist, "_ref_g_nas" + sup_key),
+                (self.g_kd_reclist, "_ref_g_kd"),
+                (self.g_ka_reclist, "_ref_g_ka"),
+                (self.g_kds_reclist, "_ref_g_kds"),
+                (self.g_kca_reclist, "_ref_g_kca"),
+                (self.g_can_reclist, "_ref_g_can"),
+                (self.g_cat_reclist, "_ref_g_cat"),
+            )
 
     def get_membrane_conductance(self):
         """
         get the membrane voltage at the end of simulation. For internal use only.
+        NB: [S/cm^{2}] (see Neuron unit)
         """
-        g_mem_rec = []
-        if self.model in ["HH", "Rattay_Aberham"]:
-            g_mem_rec = np.zeros((self.Nrec, self.t_len))
-            for k in range(self.Nrec):
-                g_mem_rec[k, :] = (
-                    np.asarray(self.g_na_reclist[k])
-                    + np.asarray(self.g_k_reclist[k])
-                    + np.asarray(self.g_l_reclist[k])
-                )
-        return g_mem_rec
+        return sum(self.get_ionic_conductance())
 
     def get_ionic_conductance(self):
         """
-        get the membrane voltage at the end of simulation. For internal use only.
+        get the membrane conductance at the end of simulation. For internal use only.
+        NB: [S/cm^{2}] (see Neuron unit)
         """
         results = []
-        if self.model in ["HH", "Rattay_Aberham"]:
-            g_na_rec = np.zeros((self.Nrec, self.t_len))
-            g_k_rec = np.zeros((self.Nrec, self.t_len))
-            g_l_rec = np.zeros((self.Nrec, self.t_len))
-            for k in range(self.Nrec):
-                g_na_rec[k, :] = np.asarray(self.g_na_reclist[k])
-                g_k_rec[k, :] = np.asarray(self.g_k_reclist[k])
-                g_l_rec[k, :] = np.asarray(self.g_l_reclist[k])
-            results = [g_na_rec, g_k_rec, g_l_rec]
+        if self.model in ["HH", "Rattay_Aberham", "Sundt"]:
+            results += [self.__get_recorders_from_list(self.g_na_reclist)]
+            results += [self.__get_recorders_from_list(self.g_k_reclist)]
+            results += [self.__get_recorders_from_list(self.g_l_reclist)]
+        elif self.model == "Tigerholm":
+            results += [self.__get_recorders_from_list(self.g_nav17_reclist)]
+            results += [self.__get_recorders_from_list(self.g_nav18_reclist)]
+            results += [self.__get_recorders_from_list(self.g_nav19_reclist)]
+            results += [self.__get_recorders_from_list(self.g_kA_reclist)]
+            results += [self.__get_recorders_from_list(self.g_kM_reclist)]
+            results += [self.__get_recorders_from_list(self.g_kdr_reclist)]
+            results += [self.__get_recorders_from_list(self.g_kna_reclist)]
+            results += [self.__get_recorders_from_list(self.g_h_reclist)]
+            results += [self.__get_recorders_from_list(self.g_naleak_reclist)]
+            results += [self.__get_recorders_from_list(self.g_kleak_reclist)]
+        else:
+            results += [self.__get_recorders_from_list(self.g_naf_reclist)]
+            results += [self.__get_recorders_from_list(self.g_nas_reclist)]
+            results += [self.__get_recorders_from_list(self.g_kd_reclist)]
+            results += [self.__get_recorders_from_list(self.g_ka_reclist)]
+            results += [self.__get_recorders_from_list(self.g_kds_reclist)]
+            results += [self.__get_recorders_from_list(self.g_kca_reclist)]
+            results += [self.__get_recorders_from_list(self.g_can_reclist)]
+            results += [self.__get_recorders_from_list(self.g_cat_reclist)]
         return results
 
+    def get_membrane_capacitance(self):
+        """
+        get the membrane capacitance
+        NB: [uF/cm^{2}] (see Neuron unit)
+        """
+        return self.__get_var_from_mod('_ref_cm')
+
     def set_particules_values_recorders(self):
         """
         Prepare the particule value recording. For internal use only.
         """
-        if self.model == "HH":
-            self.hhmreclist = neuron.h.List()
-            self.hhnreclist = neuron.h.List()
-            self.hhhreclist = neuron.h.List()
-            for k in range(self.Nsec):
-                for pos in self.rec_position_list[k]:
-                    hhm = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_m_hh,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    hhn = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_n_hh,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    hhh = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_h_hh,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    self.hhmreclist.append(hhm)
-                    self.hhnreclist.append(hhn)
-                    self.hhhreclist.append(hhh)
-        elif self.model == "Rattay_Aberham":
-            self.hhmreclist = neuron.h.List()
-            self.hhnreclist = neuron.h.List()
-            self.hhhreclist = neuron.h.List()
-            for k in range(self.Nsec):
-                for pos in self.rec_position_list[k]:
-                    hhm = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_m_RattayAberham,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    hhn = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_n_RattayAberham,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    hhh = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_h_RattayAberham,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    self.hhmreclist.append(hhm)
-                    self.hhnreclist.append(hhn)
-                    self.hhhreclist.append(hhh)
-        elif self.model == "Sundt":
+
+        if self.model in ["HH", "Rattay_Aberham", "Sundt"]:
             self.hhmreclist = neuron.h.List()
             self.hhnreclist = neuron.h.List()
             self.hhhreclist = neuron.h.List()
-            for k in range(self.Nsec):
-                for pos in self.rec_position_list[k]:
-                    hhm = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_m_nahh,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    hhn = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_n_borgkdr,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    hhh = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_h_nahh,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    self.hhmreclist.append(hhm)
-                    self.hhnreclist.append(hhn)
-                    self.hhhreclist.append(hhh)
+            if self.model == "HH":
+                self.__set_recorders_with_key(
+                    (self.hhmreclist, "_ref_m_hh"),
+                    (self.hhnreclist, "_ref_n_hh"),
+                    (self.hhhreclist, "_ref_h_hh"),
+                )
+            elif self.model == "Rattay_Aberham":
+                self.__set_recorders_with_key(
+                    (self.hhmreclist, "_ref_m_RattayAberham"),
+                    (self.hhnreclist, "_ref_n_RattayAberham"),
+                    (self.hhhreclist, "_ref_h_RattayAberham"),
+                )
+            else:
+                self.__set_recorders_with_key(
+                    (self.hhmreclist, "_ref_m_nahh"),
+                    (self.hhnreclist, "_ref_n_borgkdr"),
+                    (self.hhhreclist, "_ref_h_nahh"),
+                )
         elif self.model == "Tigerholm":
             # NAV 1.8
             self.m_nav18_reclist = neuron.h.List()
@@ -812,106 +814,27 @@ def set_particules_values_recorders(self):
             # Hyperpolarization channel
             self.ns_h_reclist = neuron.h.List()
             self.nf_h_reclist = neuron.h.List()
-            for k in range(self.Nsec):
-                for pos in self.rec_position_list[k]:
-                    # NAV 1.8
-                    m_nav18 = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_m_nav1p8,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    h_nav18 = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_h_nav1p8,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    s_nav18 = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_s_nav1p8,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    u_nav18 = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_u_nav1p8,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    self.m_nav18_reclist.append(m_nav18)
-                    self.h_nav18_reclist.append(h_nav18)
-                    self.s_nav18_reclist.append(s_nav18)
-                    self.u_nav18_reclist.append(u_nav18)
-                    # NAV 1.9
-                    m_nav19 = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_m_nav1p9,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    h_nav19 = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_h_nav1p9,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    s_nav19 = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_s_nav1p9,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    self.m_nav19_reclist.append(m_nav19)
-                    self.h_nav19_reclist.append(h_nav19)
-                    self.s_nav19_reclist.append(s_nav19)
-                    # NATTX - sensitive
-                    m_nattxs = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_m_nattxs,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    h_nattxs = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_h_nattxs,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    s_nattxs = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_s_nattxs,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    self.m_nattxs_reclist.append(m_nattxs)
-                    self.h_nattxs_reclist.append(h_nattxs)
-                    self.s_nattxs_reclist.append(s_nattxs)
-                    # K delayed rectifier
-                    n_kdr = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_n_kdrTiger,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    self.n_kdr_reclist.append(n_kdr)
-                    # K fast channel
-                    m_kf = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_m_kf,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    h_kf = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_h_kf,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    self.m_kf_reclist.append(m_kf)
-                    self.h_kf_reclist.append(h_kf)
-                    # K slow channel
-                    ns_ks = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_ns_ks,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    nf_ks = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_nf_ks,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    self.ns_ks_reclist.append(ns_ks)
-                    self.nf_ks_reclist.append(nf_ks)
-                    # Sodium dependent K channel
-                    w_kna = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_w_kna,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    self.w_kna_reclist.append(w_kna)
-                    # Hyperpolarization channel
-                    ns_h = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_ns_h,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    nf_h = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_nf_h,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    self.ns_h_reclist.append(ns_h)
-                    self.nf_h_reclist.append(nf_h)
+
+            self.__set_recorders_with_key(
+                (self.m_nav18_reclist, "_ref_m_nav1p8"),
+                (self.h_nav18_reclist, "_ref_h_nav1p8"),
+                (self.s_nav18_reclist, "_ref_s_nav1p8"),
+                (self.u_nav18_reclist, "_ref_u_nav1p8"),
+                (self.m_nav19_reclist, "_ref_m_nav1p9"),
+                (self.h_nav19_reclist, "_ref_h_nav1p9"),
+                (self.s_nav19_reclist, "_ref_s_nav1p9"),
+                (self.m_nattxs_reclist, "_ref_m_nattxs"),
+                (self.h_nattxs_reclist, "_ref_h_nattxs"),
+                (self.s_nattxs_reclist, "_ref_s_nattxs"),
+                (self.n_kdr_reclist, "_ref_n_kdrTiger"),
+                (self.m_kf_reclist, "_ref_m_kf"),
+                (self.h_kf_reclist, "_ref_h_kf"),
+                (self.ns_ks_reclist, "_ref_ns_ks"),
+                (self.nf_ks_reclist, "_ref_nf_ks"),
+                (self.w_kna_reclist, "_ref_w_kna"),
+                (self.ns_h_reclist, "_ref_ns_h"),
+                (self.nf_h_reclist, "_ref_nf_h"),
+            )
         else:  # should be both Schild_94 or Schild_97
             # High Threshold long lasting Ca
             self.d_can_reclist = neuron.h.List()
@@ -930,69 +853,19 @@ def set_particules_values_recorders(self):
             # Slowly inactivated K
             self.x_kds_reclist = neuron.h.List()
             self.y1_kds_reclist = neuron.h.List()
-            for k in range(self.Nsec):
-                for pos in self.rec_position_list[k]:
-                    # High Threshold long lasting Ca
-                    d_can = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_d_can,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    f1_can = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_f1_can,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    f2_can = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_f2_can,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    self.d_can_reclist.append(d_can)
-                    self.f1_can_reclist.append(f1_can)
-                    self.f2_can_reclist.append(f2_can)
-                    # Low Threshold transient Ca
-                    d_cat = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_d_cat,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    f_cat = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_f_cat,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    self.d_cat_reclist.append(d_cat)
-                    self.f_cat_reclist.append(f_cat)
-                    # Early Transient Outward K
-                    p_ka = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_p_ka,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    q_ka = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_q_ka,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    self.p_ka_reclist.append(p_ka)
-                    self.q_ka_reclist.append(q_ka)
-                    # Ca activated K
-                    c_kca = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_c_kca,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    self.c_kca_reclist.append(c_kca)
-                    # Delayed rectifier K
-                    n_kd = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_n_kd,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    self.n_kd_reclist.append(n_kd)
-                    # Slowly inactivated K
-                    x_kds = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_x_kds,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    y1_kds = neuron.h.Vector().record(
-                        self.unmyelinated_sections[k](pos)._ref_y1_kds,
-                        sec=self.unmyelinated_sections[k],
-                    )
-                    self.x_kds_reclist.append(x_kds)
-                    self.y1_kds_reclist.append(y1_kds)
+            self.__set_recorders_with_key(
+                (self.d_can_reclist, "_ref_d_can"),
+                (self.f1_can_reclist, "_ref_f1_can"),
+                (self.f2_can_reclist, "_ref_f2_can"),
+                (self.d_cat_reclist, "_ref_d_cat"),
+                (self.f_cat_reclist, "_ref_f_cat"),
+                (self.p_ka_reclist, "_ref_p_ka"),
+                (self.q_ka_reclist, "_ref_q_ka"),
+                (self.c_kca_reclist, "_ref_c_kca"),
+                (self.n_kd_reclist, "_ref_n_kd"),
+                (self.x_kds_reclist, "_ref_x_kds"),
+                (self.y1_kds_reclist, "_ref_y1_kds"),
+            )
             if self.model == "Schild_94":
                 # Fast Na
                 self.m_naf_reclist = neuron.h.List()
@@ -1001,35 +874,13 @@ def set_particules_values_recorders(self):
                 # Slow Na
                 self.m_nas_reclist = neuron.h.List()
                 self.h_nas_reclist = neuron.h.List()
-                for k in range(self.Nsec):
-                    for pos in self.rec_position_list[k]:
-                        # Fast Na
-                        m_naf = neuron.h.Vector().record(
-                            self.unmyelinated_sections[k](pos)._ref_m_naf,
-                            sec=self.unmyelinated_sections[k],
-                        )
-                        h_naf = neuron.h.Vector().record(
-                            self.unmyelinated_sections[k](pos)._ref_h_naf,
-                            sec=self.unmyelinated_sections[k],
-                        )
-                        l_naf = neuron.h.Vector().record(
-                            self.unmyelinated_sections[k](pos)._ref_l_naf,
-                            sec=self.unmyelinated_sections[k],
-                        )
-                        self.m_naf_reclist.append(m_naf)
-                        self.h_naf_reclist.append(h_naf)
-                        self.l_naf_reclist.append(l_naf)
-                        # Slow Na
-                        m_nas = neuron.h.Vector().record(
-                            self.unmyelinated_sections[k](pos)._ref_m_nas,
-                            sec=self.unmyelinated_sections[k],
-                        )
-                        h_nas = neuron.h.Vector().record(
-                            self.unmyelinated_sections[k](pos)._ref_h_nas,
-                            sec=self.unmyelinated_sections[k],
-                        )
-                        self.m_nas_reclist.append(m_nas)
-                        self.h_nas_reclist.append(h_nas)
+                self.__set_recorders_with_key(
+                    (self.m_naf_reclist, "_ref_m_naf"),
+                    (self.h_naf_reclist, "_ref_h_naf"),
+                    (self.l_naf_reclist, "_ref_l_naf"),
+                    (self.m_nas_reclist, "_ref_m_nas"),
+                    (self.h_nas_reclist, "_ref_h_nas"),
+                )
             else:  # should be Schild_94
                 # Fast Na
                 self.m_naf_reclist = neuron.h.List()
@@ -1037,172 +888,58 @@ def set_particules_values_recorders(self):
                 # Slow Na
                 self.m_nas_reclist = neuron.h.List()
                 self.h_nas_reclist = neuron.h.List()
-                for k in range(self.Nsec):
-                    for pos in self.rec_position_list[k]:
-                        # Fast Na
-                        m_naf = neuron.h.Vector().record(
-                            self.unmyelinated_sections[k](pos)._ref_m_naf97mean,
-                            sec=self.unmyelinated_sections[k],
-                        )
-                        h_naf = neuron.h.Vector().record(
-                            self.unmyelinated_sections[k](pos)._ref_h_naf97mean,
-                            sec=self.unmyelinated_sections[k],
-                        )
-                        self.m_naf_reclist.append(m_naf)
-                        self.h_naf_reclist.append(h_naf)
-                        # Slow Na
-                        m_nas = neuron.h.Vector().record(
-                            self.unmyelinated_sections[k](pos)._ref_m_nas97mean,
-                            sec=self.unmyelinated_sections[k],
-                        )
-                        h_nas = neuron.h.Vector().record(
-                            self.unmyelinated_sections[k](pos)._ref_h_nas97mean,
-                            sec=self.unmyelinated_sections[k],
-                        )
-                        self.m_nas_reclist.append(m_nas)
-                        self.h_nas_reclist.append(h_nas)
+                self.__set_recorders_with_key(
+                    (self.m_naf_reclist, "_ref_m_naf97mean"),
+                    (self.h_naf_reclist, "_ref_h_naf97mean"),
+                    (self.m_nas_reclist, "_ref_m_nas97mean"),
+                    (self.h_nas_reclist, "_ref_h_nas97mean"),
+                )
 
     def get_particles_values(self):
         """
         get the particules values at the end of simulation. For internal use only.
         """
+        results = []
         if self.model in ["HH", "Rattay_Aberham", "Sundt"]:
-            m_ax = np.zeros((self.Nrec, self.t_len))
-            n_ax = np.zeros((self.Nrec, self.t_len))
-            h_ax = np.zeros((self.Nrec, self.t_len))
-            for k in range(self.Nrec):
-                m_ax[k, :] = np.asarray(self.hhmreclist[k])
-                n_ax[k, :] = np.asarray(self.hhnreclist[k])
-                h_ax[k, :] = np.asarray(self.hhhreclist[k])
-            results = [m_ax, n_ax, h_ax]
+            results += [self.__get_recorders_from_list(self.hhmreclist)]
+            results += [self.__get_recorders_from_list(self.hhnreclist)]
+            results += [self.__get_recorders_from_list(self.hhhreclist)]
         elif self.model in ["Tigerholm"]:
-            m_nav18_ax = np.zeros((self.Nrec, self.t_len))
-            h_nav18_ax = np.zeros((self.Nrec, self.t_len))
-            s_nav18_ax = np.zeros((self.Nrec, self.t_len))
-            u_nav18_ax = np.zeros((self.Nrec, self.t_len))
-            m_nav19_ax = np.zeros((self.Nrec, self.t_len))
-            h_nav19_ax = np.zeros((self.Nrec, self.t_len))
-            s_nav19_ax = np.zeros((self.Nrec, self.t_len))
-            m_nattxs_ax = np.zeros((self.Nrec, self.t_len))
-            h_nattxs_ax = np.zeros((self.Nrec, self.t_len))
-            s_nattxs_ax = np.zeros((self.Nrec, self.t_len))
-            n_kdr_ax = np.zeros((self.Nrec, self.t_len))
-            m_kf_ax = np.zeros((self.Nrec, self.t_len))
-            h_kf_ax = np.zeros((self.Nrec, self.t_len))
-            ns_ks_ax = np.zeros((self.Nrec, self.t_len))
-            nf_ks_ax = np.zeros((self.Nrec, self.t_len))
-            w_kna_ax = np.zeros((self.Nrec, self.t_len))
-            ns_h_ax = np.zeros((self.Nrec, self.t_len))
-            nf_h_ax = np.zeros((self.Nrec, self.t_len))
-            for k in range(self.Nrec):
-                m_nav18_ax[k, :] = np.asarray(self.m_nav18_reclist[k])
-                h_nav18_ax[k, :] = np.asarray(self.h_nav18_reclist[k])
-                s_nav18_ax[k, :] = np.asarray(self.s_nav18_reclist[k])
-                u_nav18_ax[k, :] = np.asarray(self.u_nav18_reclist[k])
-                m_nav19_ax[k, :] = np.asarray(self.m_nav19_reclist[k])
-                h_nav19_ax[k, :] = np.asarray(self.h_nav19_reclist[k])
-                s_nav19_ax[k, :] = np.asarray(self.s_nav19_reclist[k])
-                m_nattxs_ax[k, :] = np.asarray(self.m_nattxs_reclist[k])
-                h_nattxs_ax[k, :] = np.asarray(self.h_nattxs_reclist[k])
-                s_nattxs_ax[k, :] = np.asarray(self.s_nattxs_reclist[k])
-                n_kdr_ax[k, :] = np.asarray(self.n_kdr_reclist[k])
-                m_kf_ax[k, :] = np.asarray(self.m_kf_reclist[k])
-                h_kf_ax[k, :] = np.asarray(self.h_kf_reclist[k])
-                ns_ks_ax[k, :] = np.asarray(self.ns_ks_reclist[k])
-                nf_ks_ax[k, :] = np.asarray(self.nf_ks_reclist[k])
-                w_kna_ax[k, :] = np.asarray(self.w_kna_reclist[k])
-                ns_h_ax[k, :] = np.asarray(self.ns_h_reclist[k])
-                nf_h_ax[k, :] = np.asarray(self.nf_h_reclist[k])
-            results = [
-                m_nav18_ax,
-                h_nav18_ax,
-                s_nav18_ax,
-                u_nav18_ax,
-                m_nav19_ax,
-                h_nav19_ax,
-                s_nav19_ax,
-                m_nattxs_ax,
-                h_nattxs_ax,
-                s_nattxs_ax,
-                n_kdr_ax,
-                m_kf_ax,
-                h_kf_ax,
-                ns_ks_ax,
-                nf_ks_ax,
-                w_kna_ax,
-                ns_h_ax,
-                nf_h_ax,
-            ]
+            results += [self.__get_recorders_from_list(self.m_nav18_reclist)]
+            results += [self.__get_recorders_from_list(self.h_nav18_reclist)]
+            results += [self.__get_recorders_from_list(self.s_nav18_reclist)]
+            results += [self.__get_recorders_from_list(self.u_nav18_reclist)]
+            results += [self.__get_recorders_from_list(self.m_nav19_reclist)]
+            results += [self.__get_recorders_from_list(self.h_nav19_reclist)]
+            results += [self.__get_recorders_from_list(self.s_nav19_reclist)]
+            results += [self.__get_recorders_from_list(self.m_nattxs_reclist)]
+            results += [self.__get_recorders_from_list(self.h_nattxs_reclist)]
+            results += [self.__get_recorders_from_list(self.s_nattxs_reclist)]
+            results += [self.__get_recorders_from_list(self.n_kdr_reclist)]
+            results += [self.__get_recorders_from_list(self.m_kf_reclist)]
+            results += [self.__get_recorders_from_list(self.h_kf_reclist)]
+            results += [self.__get_recorders_from_list(self.ns_ks_reclist)]
+            results += [self.__get_recorders_from_list(self.nf_ks_reclist)]
+            results += [self.__get_recorders_from_list(self.w_kna_reclist)]
+            results += [self.__get_recorders_from_list(self.ns_h_reclist)]
+            results += [self.__get_recorders_from_list(self.nf_h_reclist)]
+
         else:  # should be "Schild_94" or "Schild_97"
-            d_can_ax = np.zeros((self.Nrec, self.t_len))
-            f1_can_ax = np.zeros((self.Nrec, self.t_len))
-            f2_can_ax = np.zeros((self.Nrec, self.t_len))
-            d_cat_ax = np.zeros((self.Nrec, self.t_len))
-            f_cat_ax = np.zeros((self.Nrec, self.t_len))
-            p_ka_ax = np.zeros((self.Nrec, self.t_len))
-            q_ka_ax = np.zeros((self.Nrec, self.t_len))
-            c_kca_ax = np.zeros((self.Nrec, self.t_len))
-            n_kd_ax = np.zeros((self.Nrec, self.t_len))
-            x_kds_ax = np.zeros((self.Nrec, self.t_len))
-            y1_kds_ax = np.zeros((self.Nrec, self.t_len))
-            m_naf_ax = np.zeros((self.Nrec, self.t_len))
-            h_naf_ax = np.zeros((self.Nrec, self.t_len))
-            m_nas_ax = np.zeros((self.Nrec, self.t_len))
-            h_nas_ax = np.zeros((self.Nrec, self.t_len))
-            for k in range(self.Nrec):
-                d_can_ax[k, :] = np.asarray(self.d_can_reclist[k])
-                f1_can_ax[k, :] = np.asarray(self.f1_can_reclist[k])
-                f2_can_ax[k, :] = np.asarray(self.f2_can_reclist[k])
-                d_cat_ax[k, :] = np.asarray(self.d_cat_reclist[k])
-                f_cat_ax[k, :] = np.asarray(self.f_cat_reclist[k])
-                p_ka_ax[k, :] = np.asarray(self.p_ka_reclist[k])
-                q_ka_ax[k, :] = np.asarray(self.q_ka_reclist[k])
-                c_kca_ax[k, :] = np.asarray(self.c_kca_reclist[k])
-                n_kd_ax[k, :] = np.asarray(self.n_kd_reclist[k])
-                x_kds_ax[k, :] = np.asarray(self.x_kds_reclist[k])
-                y1_kds_ax[k, :] = np.asarray(self.y1_kds_reclist[k])
-                m_naf_ax[k, :] = np.asarray(self.m_naf_reclist[k])
-                h_naf_ax[k, :] = np.asarray(self.h_naf_reclist[k])
-                m_nas_ax[k, :] = np.asarray(self.m_nas_reclist[k])
-                h_nas_ax[k, :] = np.asarray(self.h_nas_reclist[k])
-            if self.model == "Schild_97":
-                results = [
-                    d_can_ax,
-                    f1_can_ax,
-                    f2_can_ax,
-                    d_cat_ax,
-                    f_cat_ax,
-                    p_ka_ax,
-                    q_ka_ax,
-                    c_kca_ax,
-                    n_kd_ax,
-                    x_kds_ax,
-                    y1_kds_ax,
-                    m_naf_ax,
-                    h_naf_ax,
-                    m_nas_ax,
-                    h_nas_ax,
-                ]
-            else:  # should be "Schild 94"
-                l_naf_ax = np.zeros((self.Nrec, self.t_len))
-                for k in range(self.Nrec):
-                    l_naf_ax[k, :] = np.asarray(self.l_naf_reclist[k])
-                results = [
-                    d_can_ax,
-                    f1_can_ax,
-                    f2_can_ax,
-                    d_cat_ax,
-                    f_cat_ax,
-                    p_ka_ax,
-                    q_ka_ax,
-                    c_kca_ax,
-                    n_kd_ax,
-                    x_kds_ax,
-                    y1_kds_ax,
-                    m_naf_ax,
-                    h_naf_ax,
-                    l_naf_ax,
-                    m_nas_ax,
-                    h_nas_ax,
-                ]
+            results += [self.__get_recorders_from_list(self.d_can_reclist)]
+            results += [self.__get_recorders_from_list(self.f1_can_reclist)]
+            results += [self.__get_recorders_from_list(self.f2_can_reclist)]
+            results += [self.__get_recorders_from_list(self.d_cat_reclist)]
+            results += [self.__get_recorders_from_list(self.f_cat_reclist)]
+            results += [self.__get_recorders_from_list(self.p_ka_reclist)]
+            results += [self.__get_recorders_from_list(self.q_ka_reclist)]
+            results += [self.__get_recorders_from_list(self.c_kca_reclist)]
+            results += [self.__get_recorders_from_list(self.n_kd_reclist)]
+            results += [self.__get_recorders_from_list(self.x_kds_reclist)]
+            results += [self.__get_recorders_from_list(self.y1_kds_reclist)]
+            results += [self.__get_recorders_from_list(self.m_naf_reclist)]
+            results += [self.__get_recorders_from_list(self.h_naf_reclist)]
+            results += [self.__get_recorders_from_list(self.m_nas_reclist)]
+            results += [self.__get_recorders_from_list(self.h_nas_reclist)]
+            if self.model == "Schild_94":
+                results += [self.__get_recorders_from_list(self.l_naf_reclist)]
         return results
diff --git a/nrv/utils/cell/CL_postprocessing.py b/nrv/utils/cell/CL_postprocessing.py
index f4c55ed1..6dc96fa0 100644
--- a/nrv/utils/cell/CL_postprocessing.py
+++ b/nrv/utils/cell/CL_postprocessing.py
@@ -11,8 +11,10 @@
 from scipy import signal
 
 from ...backend.file_handler import is_iterable, json_dump, json_load
-from ...backend.log_interface import pass_info, rise_warning
+from ...backend.log_interface import pass_info, rise_warning, rise_error
 from ..units import *
+from ...nmod.unmyelinated import unmyelinated
+from ...nmod.myelinated import myelinated
 
 # enable faulthandler to ease 'segmentation faults' debug
 faulthandler.enable()
@@ -176,6 +178,27 @@ def remove_non_NoR_zones(my_dict, key):
         )
 
 
+def generate_axon_from_results(results):
+    """
+    generate a blank axon with the same dimensions as in the results
+
+    Parameters
+    ----------
+    results_sim     : dict
+        results of axon.simulate method
+
+    Returns
+    -------
+    ax              : unmyelinated or myelinated
+        blank axon with the same dimensions as in the results
+    """
+    if not results["myelinated"]:
+        ax = unmyelinated(**results)
+    else:
+        ax = myelinated(**results)
+    return ax
+
+
 ############################
 ## AXON SIGNAL PROCESSING ##
 ############################
@@ -898,6 +921,131 @@ def axon_state(results_sim, save=False, saving_file="axon_state.json"):
     return axon_state
 
 
+##############################
+## Axon properties function ##
+##############################
+
+
+def get_index_myelinated_sequence(results, n):
+    """
+    Returns the sequence
+
+    Parameters
+    ----------
+    results_sim     : dict
+        results of axon.simulate method
+
+    Returns
+    -------
+    n_center              : int
+        value of the cutoff frequency of the axon's membrane
+    """
+    if not results["myelinated"] or results["rec"] == "node":
+        return "node"
+    else:
+        if n > len(results["x_rec"]):
+            rise_warning("index not in axon")
+        # +1 required because nbr of computation point = nbr seg/sec + 1
+        # see if it's a bug
+        Nseg_per_sec = results["Nseg_per_sec"] + 1
+        N_sec_type = 11
+        seq_types = results["sequence"]
+        if n == 0:
+            return seq_types[0]
+        else:
+            return seq_types[((n - 1) // Nseg_per_sec) % N_sec_type]
+
+
+def find_central_node_index(results):
+    """
+    Returns the index of the closer node from the center from a dictionnary results
+
+    Parameters
+    ----------
+    results_sim     : dict
+        results of axon.simulate method
+
+    Returns
+    -------
+    n_center              : int
+        value of the cutoff frequency of the axon's membrane
+    """
+    n_center = len(results["x_rec"]) // 2
+    if not results["myelinated"] or results["rec"] == "node":
+        return n_center
+    else:
+        for i in range(n_center):
+            if get_index_myelinated_sequence(results, n_center + i) == "node":
+                return n_center + i
+            elif get_index_myelinated_sequence(results, n_center - i) == "node":
+                return n_center - i
+    rise_warning("No node found in the axon")
+    return n_center
+
+
+def compute_f_mem(results):
+    """
+    compute the cutoff frequency of the axon's membrane and add it to the simulation results dictionnary
+    NB: The frequency is computed in [kHz]
+
+    Parameters
+    ----------
+    results_sim     : dict
+        results of axon.simulate method
+
+    Returns
+    -------
+    f_mem              : np.ndarray
+        value of the cutoff frequency of the axon's membrane
+    """
+
+    if "g_mem" not in results:
+        rise_warning("f_mem cannot be computed computed without membrane conductivity")
+        return None
+    if "f_mem" not in results:
+        ax = generate_axon_from_results(results)
+        results["c_mem"] = ax.get_membrane_capacitance()
+        del ax
+    N_x, N_t = np.shape(results["g_mem"])
+    f_mem = np.zeros((N_x, N_t))
+    for i_t in range(N_t):
+        f_mem[:, i_t] = results["g_mem"][:, i_t] / (2 * np.pi * results["c_mem"])
+
+    # in [MHz] as g_mem in [S/cm^{2}] and c_mem [uF/cm^{2}]
+    # * [MHz] to convert to [kHz]
+    results["f_mem"] = f_mem * MHz
+    return results["f_mem"]
+
+def get_myeline_properties(results):
+    """
+    compute the cutoff frequency of the axon's membrane and add it to the simulation results dictionnary
+    NB: The frequency is computed in [kHz]
+
+    Parameters
+    ----------
+    results_sim     : dict
+        results of axon.simulate method
+
+    Returns
+    -------
+    f_mem              : np.ndarray
+        value of the cutoff frequency of the axon's membrane
+    """
+    if not results["myelinated"] or results["rec"] == "node":
+        rise_warning("No myeline in the axon simulated, None returned")
+        return None
+
+    ax = generate_axon_from_results(results)
+    results["g_mye"] = ax.get_myeline_conductance()
+    results["c_mye"] = ax.get_myeline_capacitance()
+    results["f_mye"] = results["g_mye"] / (2 * np.pi * results["c_mye"])
+
+    # in [MHz] as g_mem in [S/cm^{2}] and c_mem [uF/cm^{2}]
+    # * [MHz] to convert to [kHz]
+    results["f_mem"] *= MHz
+    return results["f_mem"]
+
+
 #############################
 ## VISUALIZATION FUNCTIONS ##
 #############################


Test patch:
diff --git a/tests/unitary_tests/033_test_Rattay_aberham.py b/tests/unitary_tests/033_test_Rattay_aberham.py
index 7672c6a0..b1526f50 100644
--- a/tests/unitary_tests/033_test_Rattay_aberham.py
+++ b/tests/unitary_tests/033_test_Rattay_aberham.py
@@ -1,19 +1,20 @@
 import nrv
 import matplotlib.pyplot as plt
+import numpy as np
 
 y = 0
 z = 0
 d = 1
 L = 5000
-
+Nrec = 100
 t_start = 1
 duration = 0.5
 amplitude = 1
 
 # test 1: 1 section stim in middle
-axon1 = nrv.unmyelinated(y,z,d,L,model='Rattay_Aberham',dt=0.001,Nrec=100)
+axon1 = nrv.unmyelinated(y,z,d,L,model='Rattay_Aberham',dt=0.001,Nrec=Nrec)
 axon1.insert_I_Clamp(0.5, t_start, duration, amplitude)
-results = axon1.simulate(t_sim=10,record_I_ions=True, record_particles=True)
+results = axon1.simulate(t_sim=10,record_I_ions=True, record_particles=True, record_g_ions=True, record_g_mem=True)
 print(axon1.T == 37)
 del axon1
 
@@ -44,5 +45,72 @@
 axs[2].plot(results['t'],results['n'][25],label='n')
 axs[2].plot(results['t'],results['h'][25],label='h')
 plt.savefig('./unitary_tests/figures/33_C.png')
+del results
+# test 2: gmem for stim in left side
+cmra = 1
+gnabar_hh = 0.120
+gkbar_hh = 0.036
+gl_hh = 0.0003
+
+axon2 = nrv.unmyelinated(y,z,d,L,model='Rattay_Aberham',dt=0.001,Nrec=Nrec)
+cm0 = axon2.get_membrane_capacitance()
+axon2.insert_I_Clamp(0, t_start, duration, amplitude)
+results = axon2.simulate(t_sim=10, record_particles=True, record_g_ions=True, record_g_mem=True)
+print(axon2.T == 37)
+
+cm = axon2.get_membrane_capacitance()
+print(np.allclose(cm, cmra))
+print(np.allclose(cm0, cm))
+del axon2
+#### Check results
+gna_hh = gnabar_hh*np.multiply(np.power(results['m'],3),results['h'])
+gk_hh = gkbar_hh*np.power(results['n'],4)
+
+gm = gna_hh + gk_hh + gl_hh  # en S.cm-2
+
+### !! delay of dt between particle rec and conductance rec ###
+print(np.allclose(gna_hh[:,:-1],results['g_na'][:,1:]))
+print(np.allclose(gk_hh[:,:-1],results['g_k'][:,1:]))
+print(np.allclose(gm[:,:-1],results['g_mem'][:,1:]))
+fig2, ax1 = plt.subplots()
+ax1.set_xlabel('time (ms)')
+
+ax1.plot(results['t'],results['V_mem'][Nrec//2]-results['V_mem'][Nrec//2][0], 'k',label='Vmem variation')
+ax1.set_ylabel('Mem. Voltage (mV)')
+ax2 = ax1.twinx()
+ax1.legend(loc=2)
+
+ax2.plot(results['t'], results['g_na'][Nrec//2]*1000, label='$g_{Na}$')
+ax2.plot(results['t'], results['g_k'][Nrec//2]*1000, label='$g_{K}$')
+ax2.plot(results['t'], results['g_l'][Nrec//2]*1000, label='$g_{l}$')
+ax2.plot(results['t'], results['g_mem'][Nrec//2]*1000, label='$g_{mem}$')
+ax2.set_ylabel('conductance ($mS.cm^{-2}$)')
+ax2.legend()
+fig2.savefig('./unitary_tests/figures/33_D.png')
+
+fc = results['g_mem']/(2*np.pi*1) * nrv.MHz
+fc2 = nrv.compute_f_mem(results)
+
+print(np.allclose(fc, nrv.compute_f_mem(results)))
+
+plt.figure(figsize=(9,7))
+plt.subplot(3,1,1)
+plt.plot(results['t'],results['V_mem'][Nrec//2])
+plt.xlabel('time (ms)')
+plt.ylabel('Mem. Voltage (mV)')
+plt.grid()
+plt.legend(title = 'polarisation')
+plt.subplot(3,1,2)
+plt.semilogy(results['t'],results['g_mem'][Nrec//2])
+plt.xlabel('time (ms)')
+plt.ylabel('$g_m$ ($mS\cdot cm^{-2}$)')
+plt.grid()
+plt.subplot(3,1,3)
+plt.semilogy(results['t'],results['f_mem'][Nrec//2])
+plt.xlabel('time (ms)')
+plt.ylabel('$f_{mem}$ ($kHz$)')
+plt.grid()
+plt.tight_layout()
+plt.savefig('./unitary_tests/figures/33_E.png')
 
 #plt.show()
\ No newline at end of file
diff --git a/tests/unitary_tests/034_test_Sundt.py b/tests/unitary_tests/034_test_Sundt.py
index 3729d727..63a61628 100644
--- a/tests/unitary_tests/034_test_Sundt.py
+++ b/tests/unitary_tests/034_test_Sundt.py
@@ -1,17 +1,19 @@
 import nrv
 import matplotlib.pyplot as plt
+import numpy as np
 
+model='Sundt'
 y = 0
 z = 0
 d = 1
 L = 5000
-
+Nrec = 100
 t_start = 1
 duration = 0.5
 amplitude = 1
 
 # test 1: 1 section stim in middle
-axon1 = nrv.unmyelinated(y,z,d,L,model='Sundt',dt=0.001,Nrec=100)
+axon1 = nrv.unmyelinated(y,z,d,L,model=model,dt=0.001,Nrec=Nrec)
 axon1.insert_I_Clamp(0.5, t_start, duration, amplitude)
 results = axon1.simulate(t_sim=10,record_I_ions=True, record_particles=True)
 print(axon1.T == 37)
@@ -44,5 +46,56 @@
 axs[2].plot(results['t'],results['n'][25],label='n')
 axs[2].plot(results['t'],results['h'][25],label='h')
 plt.savefig('./unitary_tests/figures/34_C.png')
+del results
+
+# test 2: gmem for stim in left side
+cms = 1 * 1e-6 # F
+gnabar_s = 0.04
+gkbar_s = 0.04
+gl_s = 0.0003
+
+axon2 = nrv.unmyelinated(y,z,d,L,model=model,dt=0.001,Nrec=Nrec)
+axon2.insert_I_Clamp(0, t_start, duration, amplitude)
+results = axon2.simulate(t_sim=10, record_particles=True, record_g_ions=True, record_g_mem=True)
+print(axon2.T == 37)
+del axon2
+
+fc2 = nrv.compute_f_mem(results)
+
+fig2, ax1 = plt.subplots()
+ax1.set_xlabel('time (ms)')
+
+ax1.plot(results['t'],results['V_mem'][Nrec//2]-results['V_mem'][Nrec//2][0], 'k',label='Vmem variation')
+ax1.set_ylabel('Mem. Voltage (mV)')
+ax2 = ax1.twinx()
+ax1.legend(loc=2)
+
+ax2.plot(results['t'], results['g_na'][Nrec//2]*1000, label='$g_{Na}$')
+ax2.plot(results['t'], results['g_k'][Nrec//2]*1000, label='$g_{K}$')
+ax2.plot(results['t'], results['g_l'][Nrec//2]*1000, label='$g_{l}$')
+ax2.plot(results['t'], results['g_mem'][Nrec//2]*1000, label='$g_{mem}$')
+ax2.set_ylabel('conductance ($mS.cm^{-2}$)')
+ax2.legend()
+fig2.savefig('./unitary_tests/figures/34_D.png')
+
+plt.figure(figsize=(9,7))
+plt.subplot(3,1,1)
+plt.plot(results['t'],results['V_mem'][Nrec//2])
+plt.xlabel('time (ms)')
+plt.ylabel('Mem. Voltage (mV)')
+plt.grid()
+plt.legend(title = 'polarisation')
+plt.subplot(3,1,2)
+plt.semilogy(results['t'],results['g_mem'][Nrec//2])
+plt.xlabel('time (ms)')
+plt.ylabel('$g_m$ ($mS\cdot cm^{-2}$)')
+plt.grid()
+plt.subplot(3,1,3)
+plt.semilogy(results['t'],results['f_mem'][Nrec//2])
+plt.xlabel('time (ms)')
+plt.ylabel('$f_{mem}$ ($Hz$)')
+plt.grid()
+plt.tight_layout()
+plt.savefig('./unitary_tests/figures/34_E.png')
 
 #plt.show()
\ No newline at end of file
diff --git a/tests/unitary_tests/035_test_Tigerholm.py b/tests/unitary_tests/035_test_Tigerholm.py
index 6fd11aa4..637ae961 100644
--- a/tests/unitary_tests/035_test_Tigerholm.py
+++ b/tests/unitary_tests/035_test_Tigerholm.py
@@ -1,17 +1,19 @@
 import nrv
 import matplotlib.pyplot as plt
+import numpy as np
 
+model='Tigerholm'
 y = 0
 z = 0
 d = 1
 L = 5000
-
+Nrec = 100
 t_start = 1
 duration = 0.5
 amplitude = 2
 
 # test 1: 1 section stim in middle
-axon1 = nrv.unmyelinated(y,z,d,L,model='Tigerholm',dt=0.001,Nrec=100)
+axon1 = nrv.unmyelinated(y,z,d,L,model=model,dt=0.001,Nrec=Nrec)
 axon1.insert_I_Clamp(0.5, t_start, duration, amplitude)
 results = axon1.simulate(t_sim=10,record_I_ions=True, record_particles=True)
 print(axon1.T == 37)
@@ -63,6 +65,66 @@
 axs[2].plot(results['t'], results['ns_h'][25],label='ns_h')
 axs[2].plot(results['t'], results['nf_h'][25],label='nf_h')
 plt.savefig('./unitary_tests/figures/35_C.png')
+del results
+
+# test 2: gmem for stim in left side
+cmtiger = 1
+gnabar_hh = 0.120
+gkbar_hh = 0.036
+gl_hh = 0.0003
+
+axon2 = nrv.unmyelinated(y,z,d,L,model=model,dt=0.001,Nrec=Nrec)
+axon2.insert_I_Clamp(0, t_start, duration, amplitude)
+results = axon2.simulate(t_sim=10, record_particles=True, record_g_ions=True, record_g_mem=True)
+print(axon2.T == 37)
+
+cm = axon2.get_membrane_capacitance()
+print(np.allclose(cm, cmtiger))
+del axon2
+
+#### Check results
+fc2 = nrv.compute_f_mem(results)
+fig2, ax1 = plt.subplots()
+ax1.set_xlabel('time (ms)')
 
+ax1.plot(results['t'],results['V_mem'][Nrec//2]-results['V_mem'][Nrec//2][0], 'k',label='Vmem variation')
+ax1.set_ylabel('Mem. Voltage (mV)')
+ax2 = ax1.twinx()
+ax1.legend(loc=2)
+
+ax2.plot(results['t'], results['g_nav17'][Nrec//2]*1000, label='$g_{nav17}$')
+ax2.plot(results['t'], results['g_nav18'][Nrec//2]*1000, label='$g_{nav18}$')
+ax2.plot(results['t'], results['g_nav19'][Nrec//2]*1000, label='$g_{nav19}$')
+ax2.plot(results['t'], results['g_kA'][Nrec//2]*1000, label='$g_{kA}$')
+ax2.plot(results['t'], results['g_kM'][Nrec//2]*1000, label='$g_{kM}$')
+ax2.plot(results['t'], results['g_kdr'][Nrec//2]*1000, label='$g_{kdr}$')
+ax2.plot(results['t'], results['g_kna'][Nrec//2]*1000, label='$g_{kna}$')
+ax2.plot(results['t'], results['g_h'][Nrec//2]*1000, label='$g_{h}$')
+ax2.plot(results['t'], results['g_naleak'][Nrec//2]*1000, label='$g_{naleak}$')
+ax2.plot(results['t'], results['g_kleak'][Nrec//2]*1000, label='$g_{kleak}$')
+ax2.plot(results['t'], results['g_mem'][Nrec//2]*1000, label='$g_{mem}$')
+ax2.set_ylabel('conductance ($mS.cm^{-2}$)')
+ax2.legend()
+fig2.savefig('./unitary_tests/figures/35_D.png')
+
+plt.figure(figsize=(9,7))
+plt.subplot(3,1,1)
+plt.plot(results['t'],results['V_mem'][Nrec//2])
+plt.xlabel('time (ms)')
+plt.ylabel('Mem. Voltage (mV)')
+plt.grid()
+plt.legend(title = 'polarisation')
+plt.subplot(3,1,2)
+plt.semilogy(results['t'],results['g_mem'][Nrec//2])
+plt.xlabel('time (ms)')
+plt.ylabel('$g_m$ ($mS\cdot cm^{-2}$)')
+plt.grid()
+plt.subplot(3,1,3)
+plt.semilogy(results['t'],results['f_mem'][Nrec//2])
+plt.xlabel('time (ms)')
+plt.ylabel('$f_{mem}$ ($Hz$)')
+plt.grid()
+plt.tight_layout()
+plt.savefig('./unitary_tests/figures/35_E.png')
 
 #plt.show()
\ No newline at end of file
diff --git a/tests/unitary_tests/036_test_schild_94.py b/tests/unitary_tests/036_test_schild_94.py
index 90510e62..87ecf2c3 100644
--- a/tests/unitary_tests/036_test_schild_94.py
+++ b/tests/unitary_tests/036_test_schild_94.py
@@ -1,17 +1,19 @@
 import nrv
 import matplotlib.pyplot as plt
+import numpy as np
 
 y = 0
 z = 0
 d = 1
 L = 5000
-
+model = 'Schild_94'
 t_start = 1
 duration = 0.5
 amplitude = 1
+Nrec = 100
 
 # test 1: 1 section stim in middle
-axon1 = nrv.unmyelinated(y,z,d,L,model='Schild_94',dt=0.001,Nrec=100)
+axon1 = nrv.unmyelinated(y,z,d,L,model=model,dt=0.001,Nrec=Nrec)
 axon1.insert_I_Clamp(0.5, t_start, duration, amplitude)
 results = axon1.simulate(t_sim=15,record_I_ions=True, record_particles=True)
 print(axon1.T == 37)
@@ -61,6 +63,64 @@
 axs[2].plot(results['t'],results['m_nas'][25],label='m_nas')
 axs[2].plot(results['t'],results['h_nas'][25],label='h_nas')
 plt.savefig('./unitary_tests/figures/36_C.png')
+del results
+
+# test 2: gmem for stim in left side
+cmshild = 1.326291192
+gnabar_hh = 0.120
+gkbar_hh = 0.036
+gl_hh = 0.0003
+
+axon2 = nrv.unmyelinated(y,z,d,L,model=model,dt=0.001,Nrec=Nrec)
+cm = axon2.get_membrane_capacitance()
+axon2.insert_I_Clamp(0, t_start, duration, amplitude)
+results = axon2.simulate(t_sim=10, record_particles=True, record_g_ions=True, record_g_mem=True)
+print(axon2.T == 37)
+
+print(np.allclose(cm, cmshild))
+del axon2
+
+#### Check results
+fc2 = nrv.compute_f_mem(results)
+fig2, ax1 = plt.subplots()
+ax1.set_xlabel('time (ms)')
 
+ax1.plot(results['t'],results['V_mem'][Nrec//2]-results['V_mem'][Nrec//2][0], 'k',label='Vmem variation')
+ax1.set_ylabel('Mem. Voltage (mV)')
+ax2 = ax1.twinx()
+ax1.legend(loc=2)
+
+ax2.plot(results['t'], results['g_naf'][Nrec//2]*1000, label='$g_{naf}$')
+ax2.plot(results['t'], results['g_nas'][Nrec//2]*1000, label='$g_{nas}$')
+ax2.plot(results['t'], results['g_kd'][Nrec//2]*1000, label='$g_{kd}$')
+ax2.plot(results['t'], results['g_ka'][Nrec//2]*1000, label='$g_{ka}$')
+ax2.plot(results['t'], results['g_kds'][Nrec//2]*1000, label='$g_{kds}$')
+ax2.plot(results['t'], results['g_kca'][Nrec//2]*1000, label='$g_{kca}$')
+ax2.plot(results['t'], results['g_can'][Nrec//2]*1000, label='$g_{can}$')
+ax2.plot(results['t'], results['g_cat'][Nrec//2]*1000, label='$g_{cat}$')
+ax2.plot(results['t'], results['g_mem'][Nrec//2]*1000, label='$g_{mem}$')
+ax2.set_ylabel('conductance ($mS.cm^{-2}$)')
+ax2.legend()
+fig2.savefig('./unitary_tests/figures/36_D.png')
+
+plt.figure(figsize=(9,7))
+plt.subplot(3,1,1)
+plt.plot(results['t'],results['V_mem'][Nrec//2])
+plt.xlabel('time (ms)')
+plt.ylabel('Mem. Voltage (mV)')
+plt.grid()
+plt.legend(title = 'polarisation')
+plt.subplot(3,1,2)
+plt.semilogy(results['t'],results['g_mem'][Nrec//2])
+plt.xlabel('time (ms)')
+plt.ylabel('$g_m$ ($mS\cdot cm^{-2}$)')
+plt.grid()
+plt.subplot(3,1,3)
+plt.semilogy(results['t'],results['f_mem'][Nrec//2])
+plt.xlabel('time (ms)')
+plt.ylabel('$f_{mem}$ ($Hz$)')
+plt.grid()
+plt.tight_layout()
+plt.savefig('./unitary_tests/figures/36_E.png')
 
 #plt.show()
\ No newline at end of file
diff --git a/tests/unitary_tests/037_test_schild_97.py b/tests/unitary_tests/037_test_schild_97.py
index 7f46f198..2d2d9685 100644
--- a/tests/unitary_tests/037_test_schild_97.py
+++ b/tests/unitary_tests/037_test_schild_97.py
@@ -1,17 +1,19 @@
 import nrv
 import matplotlib.pyplot as plt
+import numpy as np
 
 y = 0
 z = 0
 d = 1
 L = 5000
-
+model = 'Schild_94'
 t_start = 1
 duration = 0.5
 amplitude = 1
+Nrec = 100
 
 # test 1: 1 section stim in middle
-axon1 = nrv.unmyelinated(y,z,d,L,model='Schild_97',dt=0.001,Nrec=100)
+axon1 = nrv.unmyelinated(y,z,d,L,model=model,dt=0.001,Nrec=Nrec)
 axon1.insert_I_Clamp(0.5, t_start, duration, amplitude)
 results = axon1.simulate(t_sim=15,record_I_ions=True, record_particles=True)
 print(axon1.T == 37)
@@ -60,6 +62,66 @@
 axs[2].plot(results['t'],results['m_nas'][25],label='m_nas')
 axs[2].plot(results['t'],results['h_nas'][25],label='h_nas')
 plt.savefig('./unitary_tests/figures/37_C.png')
+del results
+
+# test 2: gmem for stim in left side
+cmshild = 1.326291192
+gnabar_hh = 0.120
+gkbar_hh = 0.036
+gl_hh = 0.0003
+
+axon2 = nrv.unmyelinated(y,z,d,L,model=model,dt=0.001,Nrec=Nrec)
+axon2.insert_I_Clamp(0, t_start, duration, amplitude)
+results = axon2.simulate(t_sim=10, record_particles=True, record_g_ions=True, record_g_mem=True)
+print(axon2.T == 37)
+cm = axon2.get_membrane_capacitance()
+print(cm)
+print(np.allclose(cm, cmshild))
+del axon2
+
+#### Check results
+fc2 = nrv.compute_f_mem(results)
+fig2, ax1 = plt.subplots()
+ax1.set_xlabel('time (ms)')
+
+ax1.plot(results['t'],results['V_mem'][Nrec//2]-results['V_mem'][Nrec//2][0], 'k',label='Vmem variation')
+ax1.set_ylabel('Mem. Voltage (mV)')
+ax2 = ax1.twinx()
+ax1.legend(loc=2)
 
+ax2.plot(results['t'], results['g_naf'][Nrec//2]*1000, label='$g_{naf}$')
+ax2.plot(results['t'], results['g_nas'][Nrec//2]*1000, label='$g_{nas}$')
+ax2.plot(results['t'], results['g_kd'][Nrec//2]*1000, label='$g_{kd}$')
+ax2.plot(results['t'], results['g_ka'][Nrec//2]*1000, label='$g_{ka}$')
+ax2.plot(results['t'], results['g_kds'][Nrec//2]*1000, label='$g_{kds}$')
+ax2.plot(results['t'], results['g_kca'][Nrec//2]*1000, label='$g_{kca}$')
+ax2.plot(results['t'], results['g_can'][Nrec//2]*1000, label='$g_{can}$')
+ax2.plot(results['t'], results['g_cat'][Nrec//2]*1000, label='$g_{cat}$')
+ax2.plot(results['t'], results['g_mem'][Nrec//2]*1000, label='$g_{mem}$')
+ax2.set_ylabel('conductance ($mS.cm^{-2}$)')
+ax2.legend()
+fig2.savefig('./unitary_tests/figures/37_D.png')
+
+fc = results['g_mem']/(2*np.pi*nrv.cm)
+
+plt.figure(figsize=(9,7))
+plt.subplot(3,1,1)
+plt.plot(results['t'],results['V_mem'][Nrec//2])
+plt.xlabel('time (ms)')
+plt.ylabel('Mem. Voltage (mV)')
+plt.grid()
+plt.legend(title = 'polarisation')
+plt.subplot(3,1,2)
+plt.semilogy(results['t'],results['g_mem'][Nrec//2])
+plt.xlabel('time (ms)')
+plt.ylabel('$g_m$ ($mS\cdot cm^{-2}$)')
+plt.grid()
+plt.subplot(3,1,3)
+plt.semilogy(results['t'],results['f_mem'][Nrec//2])
+plt.xlabel('time (ms)')
+plt.ylabel('$f_{mem}$ ($Hz$)')
+plt.grid()
+plt.tight_layout()
+plt.savefig('./unitary_tests/figures/37_E.png')
 
 #plt.show()
\ No newline at end of file
diff --git a/tests/unitary_tests/052_test_axon_pop.py b/tests/unitary_tests/052_test_axon_pop.py
index 21920054..8fa3015b 100644
--- a/tests/unitary_tests/052_test_axon_pop.py
+++ b/tests/unitary_tests/052_test_axon_pop.py
@@ -3,19 +3,77 @@
 import matplotlib.pyplot as plt
 import time
 
-N = 100
-start = time.time()
-axons_diameters, axons_type, M_diam_list, U_diam_list = nrv.create_axon_population(N)
-t = time.time() - start
+myelinated_stats = [
+    "Schellens_1",
+    "Schellens_2",
+    "Ochoa_M",
+    "Jacobs_9_A",
+    "Jacobs_9_B",
+    "./unitary_tests/sources/Fugleholm"
+]
+unmyelinated_stats = [
+    "Ochoa_U",
+    "Jacobs_11_A",
+    "Jacobs_11_B",
+    "Jacobs_11_C",
+    "Jacobs_11_D",
+    "Jacobs_11_D",
+]
 
-print('Population of '+str(N)+' axons generated in '+str(t)+' s')
+N = 5000
 
-nrv.save_axon_population('./unitary_tests/figures/52_test.pop',axons_diameters, axons_type)
 
-axons_diameters_2, axons_type_2, M_diam_list_2, U_diam_list_2 = nrv.load_axon_population('./unitary_tests/figures/52_test.pop')
+for k in range(len(myelinated_stats)):
+    start = time.time()
+    m_stat = myelinated_stats[k]
+    u_stat = unmyelinated_stats[k]
 
-plt.figure()
-plt.hist(M_diam_list_2,bins = 12,color = 'blue',label='Myelinated')
-plt.hist(U_diam_list_2,bins = 10,color = 'red',label='Unmyelinated')
-plt.savefig('./unitary_tests/figures/52_A.png')
-#plt.show()
\ No newline at end of file
+    axons_diameters, axons_type, M_diam_list, U_diam_list = nrv.create_axon_population(N,M_stat=m_stat,U_stat=u_stat)
+    t = time.time() - start
+
+    print('Population of '+str(N)+' axons generated in '+str(t)+' s')
+
+
+
+    
+
+    plt.figure()
+    y_M, x, _ =plt.hist(M_diam_list,bins = 50,color = 'blue',label='Myelinated')
+    y_U, x, _ =plt.hist(U_diam_list,bins = 50,color = 'red',label='Unmyelinated')
+
+
+    gen, popt1, pcov1 = nrv.create_generator_from_stat(m_stat,dmin = 1,dmax = 20)
+    diam, pres = nrv.load_stat(m_stat)
+    xspace1 = np.linspace(1,20,num=500)
+    if (len(popt1)>4):
+        data = (nrv.two_Gamma(xspace1, *popt1))
+    else:
+        data = (nrv.one_Gamma(xspace1, *popt1))
+    scale_factor= np.max(y_M)
+    data = data*scale_factor/np.max(data)
+    pres = pres*scale_factor/np.max(pres)
+    plt.plot(xspace1,data)
+    plt.plot(diam,pres)
+
+    gen, popt1, pcov1 = nrv.create_generator_from_stat(u_stat,dmin = 0.1,dmax = 3)
+    diam, pres = nrv.load_stat(u_stat)
+    xspace1 = np.linspace(0.1,3,num=500)
+    data = (nrv.one_Gamma(xspace1, *popt1))
+    scale_factor= np.max(y_U)
+    data = data*scale_factor/np.max(data)
+    pres = pres*scale_factor/np.max(pres)
+    plt.plot(xspace1,data)
+    plt.plot(diam,pres)
+
+    if ("Fugleholm" in m_stat):
+        m_stat = 'Fugleholm'
+
+    fig_name = '52_mpop_'+m_stat+'_upop_'+u_stat+'.png'
+    pop_name = '52_mpop_'+m_stat+'_upop_'+u_stat+'.pop'
+
+    nrv.save_axon_population('./unitary_tests/results/'+pop_name,axons_diameters, axons_type)
+    axons_diameters_2, axons_type_2, M_diam_list_2, U_diam_list_2 = nrv.load_axon_population('./unitary_tests/results/'+pop_name)
+    #print(fig_name)
+    plt.savefig('./unitary_tests/figures/'+fig_name)
+    plt.close('all')
+    #plt.show()
diff --git a/tests/unitary_tests/053_test_packer.py b/tests/unitary_tests/053_test_packer.py
index 98b1f001..ef103134 100644
--- a/tests/unitary_tests/053_test_packer.py
+++ b/tests/unitary_tests/053_test_packer.py
@@ -11,14 +11,14 @@
 
 #test_axons = np.ones(95)
 
-test_axons, axons_type, M_diam_list, U_diam_list = nrv.load_axon_population('./unitary_tests/figures/52_test.pop')
+test_axons, axons_type, M_diam_list, U_diam_list = nrv.load_axon_population('./unitary_tests/sources/52_test.pop')
 
 start = time.time()
 y_axons, z_axons, iteration, FVF, probed_iter = nrv.axon_packer(test_axons,Delta = 0.5, monitor = False, monitoring_Folder='./unitary_tests/figures/53_test_packer/',y_gc = 100, z_gc = 200,v_att = 0.01, v_rep = 0.1)
 t = time.time() - start
 print('Packing performed in '+str(t)+' s')
 
-nrv.save_placed_axon_population('./unitary_tests/figures/53_test.ppop',test_axons, axons_type, y_axons, z_axons)
+nrv.save_placed_axon_population('./unitary_tests/results/53_test.ppop',test_axons, axons_type, y_axons, z_axons)
 
 # plot the Fiber Volme Fraction
 plt.figure()
@@ -51,4 +51,4 @@
 plt.ylim(min(z_axons)-14,max(z_axons)+14)
 plt.savefig('./unitary_tests/figures/53_B.png')
 plt.savefig('./unitary_tests/figures/53_B.pdf')
-#plt.show()
\ No newline at end of file
+#plt.show()
diff --git a/tests/unitary_tests/092_test_g_recorders_MRG.py b/tests/unitary_tests/092_test_g_recorders_MRG.py
index d81ae23e..e34540f5 100644
--- a/tests/unitary_tests/092_test_g_recorders_MRG.py
+++ b/tests/unitary_tests/092_test_g_recorders_MRG.py
@@ -9,7 +9,7 @@
 gnapbar_mrg = 0.01 # S.cm-2
 gksbar_mrg = 0.08  # S.cm-2
 gl_mrg = 0.007  # S.cm-2
-cm=1 * 1e-6 # F
+cm=2# uF/cm-2
 
 y = 0
 z = 0
@@ -34,12 +34,18 @@
 gks_mrg = gksbar_mrg*results['s']
 
 gm = gnaf_mrg + gnap_mrg + gks_mrg + gl_mrg  # en S.cm-2
-rm = 1/gm 
+rm = 1/gm
+fc = gm/(2*np.pi*cm) * nrv.MHz
 
-print(np.allclose(gnaf_mrg,results['g_na']))
-print(np.allclose(gnap_mrg,results['g_nap']))
-print(np.allclose(gks_mrg,results['g_k']))
-print(np.allclose(gm,results['g_mem']))
+print(np.allclose(gnaf_mrg[:,:-1],results['g_na'][:,1:]))
+print(np.allclose(gnap_mrg[:,:-1],results['g_nap'][:,1:]))
+print(np.allclose(gks_mrg[:,:-1],results['g_k'][:,1:]))
+print(np.allclose(gm[:,:-1],results['g_mem'][:,1:]))
+
+
+nrv.compute_f_mem(results)
+
+print(np.allclose(fc[:,:-1], results['f_mem'][:,1:]))
 
 ##### Plots results
 mid_node = 5
@@ -60,8 +66,6 @@
 ax2.legend()
 plt.savefig('./unitary_tests/figures/92_A.png')
 
-fc = results['g_mem']/(2*np.pi*cm)
-
 plt.figure(figsize=(9,7))
 plt.subplot(3,1,1)
 plt.plot(results['t'],results['V_mem'][mid_node])
@@ -75,7 +79,7 @@
 plt.ylabel('$g_m$ ($mS\cdot cm^{-2}$)')
 plt.grid()
 plt.subplot(3,1,3)
-plt.semilogy(results['t'],fc[mid_node])
+plt.semilogy(results['t'],results['f_mem'][mid_node])
 plt.xlabel('time (ms)')
 plt.ylabel('$f_{mem}$ ($Hz$)')
 plt.grid()
diff --git a/tests/unitary_tests/093_test_recorders_Gaines.py b/tests/unitary_tests/093_test_recorders_Gaines.py
index b32d3ab1..193df731 100644
--- a/tests/unitary_tests/093_test_recorders_Gaines.py
+++ b/tests/unitary_tests/093_test_recorders_Gaines.py
@@ -5,17 +5,25 @@
 import numpy as np
 import matplotlib.pyplot as plt
 
-gnafbar_mrg = 3.0 # S.cm-2
-gnapbar_mrg = 0.01 # S.cm-2
-gksbar_mrg = 0.08  # S.cm-2
-gl_mrg = 0.007  # S.cm-2
-cm=1* 1e-6 # F
+gnafbar_motor = 3.0 # S.cm-2
+gnapbar_motor = 0.01 # S.cm-2
+gksbar_motor = 0.08  # S.cm-2
+gkbar_motor = 0.02568
+gl_motor = 0.007  # S.cm-2
+
+gnafbar_sensory = gnafbar_motor
+gnapbar_sensory = gnapbar_motor
+gksbar_sensory = 0.04106  # S.cm-2
+gkbar_sensory = 0.02737
+gl_sensory = 0.006005  # S.cm-2
+cm= 2 # uF
 
 y = 0
 z = 0
 d = 10
 L = nrv.get_length_from_nodes(d, 15)
 
+print('Check Gaines_motor')
 axon1 = nrv.myelinated(y,z,d,L,dt=0.0005 ,Nseg_per_sec=1,rec='nodes', model='Gaines_motor')
 
 t_start = 2
@@ -23,31 +31,60 @@
 amplitude = 2
 axon1.insert_I_Clamp_node(2, t_start, duration, amplitude)
 
-
 t_sim=15
 results = axon1.simulate(t_sim=t_sim, record_particles=True, record_g_mem=True, record_g_ions=True)
 del axon1
 
+#### Check results
+
+gnaf_motor = gnafbar_motor*np.multiply(np.power(results['m'],3),results['h'])
+gnap_motor = gnapbar_motor*np.power(results['mp'],3)
+gks_motor = gksbar_motor*results['s']
+gk_motor = gkbar_motor * np.power(results['n'],4)
+
+gm_motor = gnaf_motor + gnap_motor + gks_motor + gk_motor + gl_motor  # en S.cm-2
+rm_motor = 1/gm_motor
+fc_motor = gm_motor/(2*np.pi*cm) * nrv.MHz
+
+
+print(np.allclose(gnaf_motor[:,:-1],results['g_na'][:,1:]))
+print(np.allclose(gnap_motor[:,:-1],results['g_nap'][:,1:]))
+print(np.allclose(gks_motor[:,:-1],results['g_k'][:,1:]))
+print(np.allclose(gks_motor[:,:-1],results['g_k'][:,1:]))
+
+print(np.allclose(gm_motor[:,:-1],results['g_mem'][:,1:]))
+
+print('Check Gaines_sensory')
 axon2 = nrv.myelinated(y,z,d,L,dt=0.0005 ,Nseg_per_sec=1,rec='nodes', model='Gaines_sensory')
 axon2.insert_I_Clamp_node(2, t_start, duration, amplitude)
 results2 = axon2.simulate(t_sim=t_sim, record_particles=True, record_g_mem=True, record_g_ions=True)
 del axon2
 
 #### Check results
-'''
-gnaf_mrg = gnafbar_mrg*np.multiply(np.power(results['m'],3),results['h'])
-gnap_mrg = gnapbar_mrg*np.power(results['mp'],3)
-gks_mrg = gksbar_mrg*results['s']
-
-gm = gnaf_mrg + gnap_mrg + gks_mrg + gl_mrg  # en S.cm-2
-rm = 1/gm       
-
-print(np.allclose(gnaf_mrg,results['g_na']))
-print(np.allclose(gnap_mrg,results['g_nap']))
-print(np.allclose(gks_mrg,results['g_k']))
-print(np.allclose(gm,results['g_mem']))
-'''
- 
+
+gnaf_sensory = gnafbar_sensory*np.multiply(np.power(results2['m'],3),results2['h'])
+gnap_sensory = gnapbar_sensory*np.power(results2['mp'],3)
+gks_sensory = gksbar_sensory*results2['s']
+gk_sensory = gkbar_sensory * np.power(results2['n'],4)
+
+gm_sensory = gnaf_sensory + gnap_sensory + gks_sensory + gk_sensory + gl_sensory  # en S.cm-2
+rm_sensory = 1/gm_sensory
+fc_sensory = gm_sensory/(2*np.pi*cm) * nrv.MHz
+
+print(np.allclose(gnaf_sensory[:,:-1],results2['g_na'][:,1:]))
+print(np.allclose(gnap_sensory[:,:-1],results2['g_nap'][:,1:]))
+print(np.allclose(gks_sensory[:,:-1],results2['g_k'][:,1:]))
+print(np.allclose(gks_sensory[:,:-1],results2['g_k'][:,1:]))
+
+print(np.allclose(gm_sensory[:,:-1],results2['g_mem'][:,1:]))
+
+
+nrv.compute_f_mem(results)
+print(np.allclose(fc_motor[:,:-1],results['f_mem'][:,1:]))
+nrv.compute_f_mem(results2)
+print(np.allclose(fc_sensory[:,:-1],results2['f_mem'][:,1:]))
+
+
 ##### Plots results
 
 mid_node = 5
@@ -91,21 +128,27 @@
 plt.savefig('./unitary_tests/figures/93_B.png')
 
 
-
-fig, ax1 = plt.subplots()
-ax1.set_xlabel('time (ms)')
-ax1.plot(results['t'],results['V_mem'][mid_node]-results['V_mem'][mid_node][0], 'k',label='Vmem motor variation')
-ax1.plot(results2['t'],results2['V_mem'][mid_node]-results2['V_mem'][mid_node][0], 'k--',label='Vmem sensory variation')
-ax1.set_ylabel('Mem. Voltage (mV)')
-ax2 = ax1.twinx()
-ax1.legend(loc=2)
-
-
-ax2.plot(results['t'], results['g_mem'][mid_node]*1000, 'b',label='$g_{mem} motor$')
-ax2.plot(results2['t'], results2['g_mem'][mid_node]*1000, 'b--',label='$g_{mem} sensory$')
-ax2.set_ylabel('conductance ($mS.cm^{-2}$)')
-ax2.legend()
-plt.xlim([0,5])
+plt.figure(figsize=(9,7))
+plt.subplot(3,1,1)
+plt.plot(results['t'],results['V_mem'][mid_node], label='motor')
+plt.plot(results2['t'],results2['V_mem'][mid_node], label='sensory')
+plt.xlabel('time (ms)')
+plt.ylabel('Mem. Voltage (mV)')
+plt.grid()
+plt.legend(title = 'polarisation')
+plt.subplot(3,1,2)
+plt.semilogy(results['t'],results['g_mem'][mid_node], label='motor')
+plt.semilogy(results2['t'],results2['g_mem'][mid_node], label='sensory')
+plt.xlabel('time (ms)')
+plt.ylabel('$g_m$ ($mS\cdot cm^{-2}$)')
+plt.grid()
+plt.subplot(3,1,3)
+plt.semilogy(results['t'],results['f_mem'][mid_node], label='motor')
+plt.semilogy(results2['t'],results2['f_mem'][mid_node], label='sensory')
+plt.xlabel('time (ms)')
+plt.ylabel('$f_{mem}$ ($Hz$)')
+plt.grid()
+plt.tight_layout()
 plt.savefig('./unitary_tests/figures/93_C.png')
 
 #plt.show()
\ No newline at end of file
diff --git a/tests/unitary_tests/097_test_rec_all_g_Gaines.py b/tests/unitary_tests/097_test_rec_all_g_Gaines.py
index a76ab924..2747ff3e 100644
--- a/tests/unitary_tests/097_test_rec_all_g_Gaines.py
+++ b/tests/unitary_tests/097_test_rec_all_g_Gaines.py
@@ -91,7 +91,7 @@
 
     plt.plot(results['t'],results['g_mem'][x],label='g_mem', color='k')
     print(seq_types[(x-1)//Nseg])
-    plt.title(seq_types[(x-1)//Nseg]+''+str(seq_index[(x-1)//Nseg]))
+    plt.title(seq_types[(x-1)//Nseg]+' '+str(seq_index[(x-1)//Nseg]))
     plt.legend()
 plt.tight_layout()
 plt.savefig('./unitary_tests/figures/97_B.png')
@@ -111,7 +111,7 @@
 
     plt.plot(results['t'],results['g_mem'][x],label='g_mem', color='k')
     print(seq_types[(x-1)//Nseg])
-    plt.title(seq_types[(x-1)//Nseg]+''+str(seq_index[(x-1)//Nseg]))
+    plt.title(seq_types[(x-1)//Nseg]+' '+str(seq_index[(x-1)//Nseg]))
     plt.legend()
 plt.tight_layout()
 plt.savefig('./unitary_tests/figures/97_C.png')
diff --git a/tests/unitary_tests/098_test_rec_all_g_Ext_Gaines.py b/tests/unitary_tests/098_test_rec_all_g_Ext_Gaines.py
index a76ab924..ddd051ad 100644
--- a/tests/unitary_tests/098_test_rec_all_g_Ext_Gaines.py
+++ b/tests/unitary_tests/098_test_rec_all_g_Ext_Gaines.py
@@ -5,115 +5,120 @@
 import numpy as np
 import matplotlib.pyplot as plt
 
-gnafbar_mrg = 3.0 # S.cm-2
-gnapbar_mrg = 0.01 # S.cm-2
-gksbar_mrg = 0.08  # S.cm-2
-gl_mrg = 0.007  # S.cm-2
-cm=1 * 1e-6 # F
+expected_seq = ['node', 'MYSA', 'FLUT', 'STIN', 'STIN', 'STIN', 'STIN', 'STIN', 'FLUT', 'MYSA', 'node', 'MYSA', 'FLUT']
+i_plot, j_plot = (4,7)
+N_plot = i_plot * j_plot
 
 ## Test1
-
-Nseg=2
+# Ax pty
+Nseg=1
 y = 0
 z = 0
-d = 6
-L = nrv.get_length_from_nodes(d, 3)
-
-axon1 = nrv.myelinated(y,z,d,L,dt=0.005,rec='all', Nseg_per_sec=Nseg-1,model='Gaines_motor')
-#print(axon1.rec_position_list)
-total = 0
-for positions in axon1.rec_position_list:
-	total += len(positions)
-#print(total)
-print(total == len(axon1.x_rec))
+d = 10
+L = nrv.get_length_from_nodes(d, 10)
+t_sim = 10
+node_shift = 0
 
+# Iclamp pty
 t_start = 1
 duration = 0.1
 amplitude = 2
-axon1.insert_I_Clamp_node(1, t_start, duration, amplitude)
-
-t_sim=5
-results = axon1.simulate(t_sim=t_sim, record_V_mem=False, record_g_mem=True, record_g_ions=True)
 
-C = len(axon1.x_rec)//2
-seq_types = axon1.axon_path_type
-seq_index = axon1.axon_path_index
+axon_mrg = nrv.myelinated(y,z,d,L,dt=0.005,rec='all', Nseg_per_sec=Nseg,model='MRG', node_shift=node_shift)
+axon_mrg.insert_I_Clamp_node(1, t_start, duration, amplitude)
+res_mrg = axon_mrg.simulate(t_sim=t_sim, record_g_mem=True, record_g_ions=True)
+del axon_mrg
+
+axon_motor = nrv.myelinated(y,z,d,L,dt=0.005,rec='all', Nseg_per_sec=Nseg,model='Gaines_motor', node_shift=node_shift)
+axon_motor.insert_I_Clamp_node(1, t_start, duration, amplitude)
+res_motor = axon_motor.simulate(t_sim=t_sim, record_g_mem=True, record_g_ions=True)
+del axon_motor
+
+axon_sensory = nrv.myelinated(y,z,d,L,dt=0.005,rec='all', Nseg_per_sec=Nseg,model='Gaines_sensory', node_shift=node_shift)
+axon_sensory.insert_I_Clamp_node(1, t_start, duration, amplitude)
+res_sensory = axon_sensory.simulate(t_sim=t_sim, record_g_mem=True, record_g_ions=True)
+del axon_sensory
+
+nrv.compute_f_mem(res_mrg)
+nrv.compute_f_mem(res_motor)
+nrv.compute_f_mem(res_sensory)
+nrv.get_myeline_properties(res_mrg)
+nrv.get_myeline_properties(res_motor)
+nrv.get_myeline_properties(res_sensory)
+
+seq_types_mrg = res_mrg['sequence']
+seq_types_motor = res_motor['sequence']
+seq_types_sensory = res_sensory['sequence']
+print(seq_types_motor[:11], res_motor['Nsec'])
+
+C = nrv.find_central_node_index(res_motor)
 print(C)
 
-print(len(axon1.x_rec), 2*len(axon1.axon_path_type), len(axon1.axon_path_index), len(axon1.rec_position_list))
-print(axon1.axon_path_type)
-print(axon1.axon_path_index)
-print(axon1.rec_position_list)
-del axon1
-
-
-
-plt.figure(figsize=(14, 10))
-plt.subplot(2,2,1)
-map = plt.pcolormesh(results['t'], results['x_rec'], results['g_mem'] ,shading='auto')
-plt.ylabel('position (µm)')
-cbar = plt.colorbar(map)
-cbar.set_label('g membrane (mV)')
-plt.tight_layout()
-
-
-plt.subplot(2,2,2)
-map = plt.pcolormesh(results['t'], results['x_rec'], results['g_nap'] ,shading='auto')
-cbar = plt.colorbar(map)
-cbar.set_label('g_nap(mV)')
-
-plt.subplot(2,2,3)
-map = plt.pcolormesh(results['t'], results['x_rec'], results['g_k'] ,shading='auto')
-plt.xlabel('time (ms)')
-plt.ylabel('position (µm)')
-cbar = plt.colorbar(map)
-cbar.set_label('g_k (mV)')
-
-plt.subplot(2,2,4)
-map = plt.pcolormesh(results['t'], results['x_rec'], results['g_q'] ,shading='auto')
-plt.xlabel('time (ms)')
-
-cbar = plt.colorbar(map)
-cbar.set_label('g_q (mV)')
-plt.savefig('./unitary_tests/figures/97_A.png')
-
-plt.figure(figsize=(15, 8))
-
-for i in range(8):
-    x = C+i
-    plt.subplot(2,4,i+1)
-    plt.plot(results['t'],results['g_na'][x],label='g_na')
-    plt.plot(results['t'],results['g_nap'][x],label='g_nap')
-    plt.plot(results['t'],results['g_k'][x],label='g_k')
-    plt.plot(results['t'],results['g_kf'][x],label='g_kf')
-    plt.plot(results['t'],results['g_l'][x],label='g_l')
-    plt.plot(results['t'],results['g_q'][x],label='g_q')
-
-    plt.plot(results['t'],results['g_mem'][x],label='g_mem', color='k')
-    print(seq_types[(x-1)//Nseg])
-    plt.title(seq_types[(x-1)//Nseg]+''+str(seq_index[(x-1)//Nseg]))
-    plt.legend()
-plt.tight_layout()
-plt.savefig('./unitary_tests/figures/97_B.png')
-
-
-plt.figure(figsize=(15, 8))
-seq = [0, 1, 2, 3, 11, 10, 9, 8]
-for i in range(8):
-    x = C+seq[i]*2
-    plt.subplot(2,4,i+1)
-    plt.plot(results['t'],results['g_na'][x],label='g_na')
-    plt.plot(results['t'],results['g_nap'][x],label='g_nap')
-    plt.plot(results['t'],results['g_k'][x],label='g_k')
-    plt.plot(results['t'],results['g_kf'][x],label='g_kf')
-    plt.plot(results['t'],results['g_l'][x],label='g_l')
-    plt.plot(results['t'],results['g_q'][x],label='g_q')
-
-    plt.plot(results['t'],results['g_mem'][x],label='g_mem', color='k')
-    print(seq_types[(x-1)//Nseg])
-    plt.title(seq_types[(x-1)//Nseg]+''+str(seq_index[(x-1)//Nseg]))
-    plt.legend()
-plt.tight_layout()
-plt.savefig('./unitary_tests/figures/97_C.png')
 
+fig1 = plt.figure(1, figsize=(20, 8))
+fig2 = plt.figure(2, figsize=(20, 8))
+fig3 = plt.figure(3, figsize=(20, 8))
+for i in range(N_plot):
+    x =  i + C
+
+    plt.figure(1)
+    plt.subplot(i_plot, j_plot,i+1)
+    plt.plot(res_mrg['t'],res_mrg['V_mem'][x],label='MRG')
+    plt.plot(res_motor['t'],res_motor['V_mem'][x],label='motor')
+    plt.plot(res_sensory['t'],res_sensory['V_mem'][x],label='sensory')
+    plt.title(str(x)+": "+nrv.get_index_myelinated_sequence(res_motor, x))
+
+    plt.figure(2)
+    ax = plt.subplot(i_plot, j_plot,i+1)
+    plt.plot(res_mrg['t'],res_mrg['g_mem'][x],label='MRG')
+    plt.plot(res_motor['t'],res_motor['g_mem'][x],label='motor')
+    plt.plot(res_sensory['t'],res_sensory['g_mem'][x],label='sensory')
+    plt.title(str(x)+": "+nrv.get_index_myelinated_sequence(res_motor, x))
+    ax.ticklabel_format(scilimits=[-1, 1], useMathText=True)
+
+    plt.figure(3)
+    ax = plt.subplot(i_plot, j_plot,i+1)
+    plt.plot(res_mrg['t'],res_mrg['f_mem'][x],label='MRG')
+    plt.plot(res_motor['t'],res_motor['f_mem'][x],label='motor')
+    plt.plot(res_sensory['t'],res_sensory['f_mem'][x],label='sensory')
+    plt.title(str(x)+": "+nrv.get_index_myelinated_sequence(res_motor, x))
+    ax.ticklabel_format(scilimits=[-1, 1], useMathText=True)
+
+plt.figure(1)
+fig1.legend(['MRG', 'motor', 'sensory'])
+fig1.tight_layout()
+fig1.savefig('./unitary_tests/figures/98_A.png')
+
+plt.figure(2)
+fig2.legend(['MRG', 'motor', 'sensory'])
+fig2.tight_layout()
+fig2.savefig('./unitary_tests/figures/98_B.png')
+
+plt.figure(3)
+fig3.legend(['MRG', 'motor', 'sensory'])
+fig3.tight_layout()
+fig3.savefig('./unitary_tests/figures/98_C.png')
+plt.close()
+
+plt.figure(4, figsize=(10,8))
+ax = plt.subplot(3, 1, 1)
+plt.plot(res_mrg['x_rec'], res_mrg['g_mye'])
+plt.plot(res_motor['x_rec'], res_motor['g_mye'])
+plt.plot(res_sensory['x_rec'], res_sensory['g_mye'])
+plt.yscale('log')
+plt.title(str(x)+": "+nrv.get_index_myelinated_sequence(res_motor, x))
+ax = plt.subplot(3, 1, 2)
+plt.plot(res_mrg['x_rec'], res_mrg['c_mye'])
+plt.plot(res_motor['x_rec'], res_motor['c_mye'])
+plt.plot(res_sensory['x_rec'], res_sensory['c_mye'])
+plt.yscale('log')
+plt.title(str(x)+": "+nrv.get_index_myelinated_sequence(res_motor, x))
+ax = plt.subplot(3, 1, 3)
+plt.plot(res_mrg['x_rec'], res_mrg['f_mye'])
+plt.plot(res_motor['x_rec'], res_motor['f_mye'])
+plt.plot(res_sensory['x_rec'], res_sensory['f_mye'])
+plt.yscale('log')
+plt.title(str(x)+": "+nrv.get_index_myelinated_sequence(res_motor, x))
+plt.savefig('./unitary_tests/figures/98_D.png')
+plt.legend(['MRG', 'motor', 'sensory'])
 #plt.show()
diff --git a/tests/unitary_tests/099_ax_from_results.py b/tests/unitary_tests/099_ax_from_results.py
new file mode 100644
index 00000000..053e176e
--- /dev/null
+++ b/tests/unitary_tests/099_ax_from_results.py
@@ -0,0 +1,34 @@
+import nrv
+import numpy as np
+
+ 
+unmy1 = nrv.unmyelinated(y=0,z=3,d=1,L=10,model="Sundt",T=25,dt=0.01, Nrec=10)
+unmy_dict1 = unmy1.save()
+results = unmy1.simulate(t_sim=1)
+del unmy1
+
+unmy2 = nrv.generate_axon_from_results(results)
+unmy_dict2 = unmy2.save()
+del unmy2
+
+for key in unmy_dict1:
+    if not key in unmy_dict2:
+        print(False)
+    else:
+        print(unmy_dict1[key]==unmy_dict2[key])
+
+
+my1 = nrv.myelinated(y=0,z=0,d=10,L=1000,model="Gaines_motor",T=25,dt=0.01, Nseg_per_sec=2)
+my_dict1 = my1.save()
+results = my1.simulate(t_sim=1)
+del my1
+
+my2 = nrv.generate_axon_from_results(results)
+my_dict2 = my2.save()
+del my2
+
+for key in my_dict1:
+    if not key in my_dict2:
+        print(False)
+    else:
+        print(my_dict1[key]==my_dict2[key])
\ No newline at end of file
diff --git a/tests/unitary_tests/112_test_FENICS_Compare_results.py b/tests/unitary_tests/112_test_FENICS_Compare_results.py
index 4f077b5e..c1990496 100644
--- a/tests/unitary_tests/112_test_FENICS_Compare_results.py
+++ b/tests/unitary_tests/112_test_FENICS_Compare_results.py
@@ -119,6 +119,6 @@
 t4 = time.time()
 print('Substraction done in '+str(t4 - t3)+' s')
 
-print(sim1.vout.x.array[:])
-print(sim2.vout.x.array[:])
-print(not np.allclose(sim1.vout.x.array, sim2.vout.x.array))
\ No newline at end of file
+#print(sim1.vout.x.array[:])
+#print(sim2.vout.x.array[:])
+print(np.allclose(sim1.vout.x.array, sim2.vout.x.array))
\ No newline at end of file
diff --git a/tests/unitary_tests/144_test_FENICS_mp.py b/tests/unitary_tests/144_test_FENICS_mp.py
new file mode 100644
index 00000000..4256a7a6
--- /dev/null
+++ b/tests/unitary_tests/144_test_FENICS_mp.py
@@ -0,0 +1,78 @@
+import nrv
+import time
+
+t0 = time.time()
+source_file = './unitary_tests/sources/56_fasc.json'
+Ntest = 144
+###########################
+## extracellular context ##
+###########################
+
+# ### Simulation box size
+Outer_D = 5
+#### Nerve and fascicle geometry
+L = 10000
+Nerve_D = 250
+Fascicle_D = 220
+##### electrode and stimulus definition
+D_1 = 25
+length_1 = 1000
+y_c_1 = 50
+z_c_1 = 50
+x_1_offset = 4500
+
+# stimulus def
+start = 1
+I_cathod = 40
+I_anod = I_cathod/5
+T_cathod = 60e-3
+T_inter = 40e-3
+stim1 = nrv.FEM_stimulation(Ncore=1)
+stim1.reshape_outerBox(Outer_D)
+stim1.reshape_nerve(Nerve_D, L)
+stim1.reshape_fascicle(Fascicle_D)#, res=220/10)
+elec_1 = nrv.LIFE_electrode('LIFE_1', D_1, length_1, x_1_offset, y_c_1, z_c_1)
+stim = nrv.stimulus()
+stim.biphasic_pulse(start, I_cathod, T_cathod, I_anod, T_inter)
+stim1.add_electrode(elec_1, stim)
+
+
+fascicle_1 = nrv.fascicle()
+fascicle_1.load(source_file)
+fascicle_1.define_length(L)
+fascicle_1.set_ID(Ntest*10)
+fascicle_1.attach_extracellular_stimulation(stim1)
+fascicle_2 = nrv.load_any(fascicle_1.save(save=False))
+
+
+#print(fascicle_1.extra_stim.model.is_multi_proc)
+fascicle_1.compute_electrodes_footprints()
+
+if nrv.MCH.do_master_only_work():
+    nrv.parameters.set_nrv_verbosity(4)
+    fascicle_1.extra_stim.model.get_timers(verbose=True)
+    nrv.parameters.set_nrv_verbosity(2)
+del fascicle_1
+
+
+
+#stim2 = nrv.load_any(stim1.save())
+stim2 = nrv.FEM_stimulation()
+stim2.reshape_outerBox(Outer_D)
+stim2.reshape_nerve(Nerve_D, L)
+stim2.reshape_fascicle(Fascicle_D)
+stim2.add_electrode(elec_1, stim)
+stim2.set_Ncore(3)
+
+fascicle_2.set_ID(Ntest*10+1)
+fascicle_2.attach_extracellular_stimulation(stim2)
+fascicle_2.compute_electrodes_footprints()
+if nrv.MCH.do_master_only_work():
+    nrv.parameters.set_nrv_verbosity(4)
+    fascicle_2.extra_stim.model.get_timers(verbose=True)
+    nrv.parameters.set_nrv_verbosity(2)
+
+#fascicle_1.simulate(t_sim=10, save_path='./unitary_tests/figures/',postproc_script='is_excited')
+t1 = time.time()
+nrv.synchronize_processes()
+print('simulation done in ' + str(t1-t0))
diff --git a/tests/unitary_tests/145_test_FENICS_save_load_NerveMshCreator.py b/tests/unitary_tests/145_test_FENICS_save_load_NerveMshCreator.py
new file mode 100644
index 00000000..37f5c76d
--- /dev/null
+++ b/tests/unitary_tests/145_test_FENICS_save_load_NerveMshCreator.py
@@ -0,0 +1,62 @@
+import nrv
+import time
+import os
+
+
+Ntest = 145
+t0 = time.time()
+## Results filenames
+json_file = "./unitary_tests/figures/" + str(Ntest) + "_mesh.json"
+mesh_file = "./unitary_tests/results/mesh/" + str(Ntest) + "_mesh"
+
+## Mesh generation
+L = 15000         #um
+Outer_D = 10    #mm
+Nerve_D = 5000 #um
+
+mesh = nrv.NerveMshCreator(Length=L,Outer_D=Outer_D,Nerve_D=Nerve_D, ver_level=2)
+
+mesh.reshape_fascicle(D=1700, y_c=700, z_c=0, ID=1)
+mesh.reshape_fascicle(D=1000, y_c=-1000, z_c=0, ID=2)
+
+
+mesh.add_electrode(elec_type="LIFE", x_c=L/4, y_c=-800, z_c=-100, length = 1000, D=25, res=5)
+mesh.add_electrode(elec_type="LIFE", x_c=3*L/4, y_c=-800, z_c=-100, length = 1000, D=25, res=5)
+
+mesh.add_electrode(elec_type="CUFF MP", N=5, x_c=L/4, contact_width = 1000, contact_length=500,\
+    insulator=True, insulator_length=3000, insulator_thickness=500,res=50)
+
+
+mesh_dic = mesh.save(save=True, fname=json_file)
+print("save not meshed ok")
+t1 = time.time()
+print('mesh set in '+str(t1 - t0)+' s')
+del mesh
+
+mesh2 = nrv.load_any(json_file)
+mesh2.compute_mesh()
+print("load not meshed ok")
+
+mesh2.save(mesh_file)
+print("save meshed ok")
+
+t2 = time.time()
+print('mesh generated in '+str(t2 - t1)+' s')
+mesh2.get_mesh_info(verbose=True)
+del mesh2
+
+
+mesh3 = nrv.load_any(mesh_file)
+mesh3.compute_mesh()
+print("load meshed ok")
+
+mesh3.save(mesh_file)
+
+t3 = time.time()
+print('mesh reloaded in '+str(t3 - t2)+' s')
+mesh3.get_mesh_info(verbose=True)
+
+
+
+#mesh.visualize()
+
diff --git a/tests/unitary_tests/503_test_FENICS_save_axon.py b/tests/unitary_tests/503_test_FENICS_save_axon.py
index 2778c79e..400d4249 100644
--- a/tests/unitary_tests/503_test_FENICS_save_axon.py
+++ b/tests/unitary_tests/503_test_FENICS_save_axon.py
@@ -6,7 +6,7 @@
 ## extracellular context ##
 ###########################
 nrv.parameters.set_nrv_verbosity(2)
-test_stim = nrv.FEM_stimulation(comsol=False)
+test_stim = nrv.FEM_stimulation()
 ### Simulation box size
 Outer_D = 5
 test_stim.reshape_outerBox(Outer_D)
diff --git a/tests/unitary_tests/sources/Fugleholm.csv b/tests/unitary_tests/sources/Fugleholm.csv
new file mode 100644
index 00000000..36a579c9
--- /dev/null
+++ b/tests/unitary_tests/sources/Fugleholm.csv
@@ -0,0 +1,16 @@
+1,0.0011668611435239206
+2,0.07001166861143523
+3,0.12135355892648775
+4,0.12252042007001167
+5,0.12135355892648775
+6,0.07117852975495916
+7,0.050175029171528586
+8,0.051341890315052506
+9,0.06884480746791131
+10,0.09684947491248541
+11,0.09684947491248541
+12,0.07234539089848308
+13,0.038506417736289385
+14,0.011668611435239206
+15,0.003500583430571762
+16,0.002333722287047841