diff --git a/.DS_Store b/.DS_Store
index ce4222c7..95854870 100644
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/.gitignore b/.gitignore
index 206905b0..019cd016 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,8 +37,10 @@ testing
Issues/test.py
Issues/Caroline
Issues/273/action_parameter/
+Issues/omer*
Examples/Polymer_branch/polymer_adele
Examples/Polymer_branch/polymer_v2
release
Issues/.DS_Store
.DS_Store
+bng2/libsource/muparser_v2_2_4
diff --git a/Issues/.DS_Store b/Issues/.DS_Store
index 38198b5a..8a05ac61 100644
Binary files a/Issues/.DS_Store and b/Issues/.DS_Store differ
diff --git a/Issues/nestedIF/BillsTest.bngl b/Issues/nestedIF/BillsTest.bngl
new file mode 100644
index 00000000..0858f592
--- /dev/null
+++ b/Issues/nestedIF/BillsTest.bngl
@@ -0,0 +1,39 @@
+begin model
+# example of NFsim error caused by too deep nesting of if-then-else
+statements in function definition
+
+begin molecule types
+V()
+counter()
+end molecule types
+
+begin seed species
+V() 0
+counter() 0
+end seed species
+
+begin observables
+Molecules t counter()
+Molecules V V()
+end observables
+
+begin functions
+# CASE 1: constant rate
+#v_rate()=1e-6
+# CASE 2: variable rate defined in terms of nested if-then-else statements
+#v_rate() 1e4*if(t<=297,1e-6,if(t<=298,1.12314383e-05,if(t<=299,9.94451901e-06,if(t<=300,4.74735912e-05,if(t<=301,2.11759573e-05,0)))))
+v_rate() 1e4*if(t<=297,1e-6,if(t<=298,1.12314383e-05,if(t<=299,9.94451901e-06,if(t<=300,4.74735912e-05,if(t<=301,2.11759573e-05,if(t<=302,0,if(t<=303,8.68001985e-05,if(t<=304,3.62421529e-05,if(t<=305,8.93918412e-05,if(t<=306,0.000146015146,if(t<=307,0.00010497702,if(t<=308,7.94473222e-05,if(t<=309,6.05025646e-05,if(t<=310,0.000364352105,if(t<=311,0.000201739564,if(t<=312,0.000357759509,if(t<=313,0.000269842203,if(t<=314,0.000257166618,if(t<=315,0.000470011593,if(t<=316,0.000451941228,if(t<=317,0.000253944211,if(t<=318,0.0006239742879999999,if(t<=319,0.00066809744,if(t<=320,0.000499101616,if(t<=321,0.000321104073,if(t<=322,0.000519506807,if(t<=323,0.000424076528,if(t<=324,0.000449397629,if(t<=325,0.000884025501,if(t<=326,0.000654416186,if(t<=327,0.00064374717,if(t<=328,0.000789273122,if(t<=329,0.000803543557,if(t<=330,0.000638530434,if(t<=331,0.00100160898,if(t<=332,0.000993807258,if(t<=333,0.00124114925,if(t<=334,0.00123426412,if(t<=335,0.00141321826,if(t<=336,0.00118332628,if(t<=337,0.00109470055,if(t<=338,0.00125019427,if(t<=339,0.00135455371,if(t<=340,0.0019431852,if(t<=341,0.00205543168,if(t<=342,0.00197207562,if(t<=343,0.0022614449,if(t<=344,0.00211490243,if(t<=345,0.00210695833,if(t<=346,0.00249495193,if(t<=347,0.00234941068,if(t<=348,0.00226462926,if(t<=349,0.00192793935,if(t<=350,0.002307822,if(t<=351,0.00177314607,if(t<=352,0.00204756246,if(t<=353,0.00223537455,if(t<=354,0.00265125171,if(t<=355,0.00215845046,if(t<=356,0.00219770402,if(t<=357,0.00178428238,if(t<=358,0.00184590186,if(t<=359,0.0018605743,if(t<=360,0.00184659497,if(t<=361,0.00229017668,if(t<=362,0.00253196493,if(t<=363,0.00239098899,if(t<=364,0.00211185421,if(t<=365,0.00219407719,if(t<=366,0.00212246707,if(t<=367,0.00269861999,if(t<=368,0.00266277044,if(t<=369,0.0022864101,if(t<=370,0.00238106143,if(t<=371,0.00288706782,if(t<=372,0.00241887213,if(t<=373,0.00264944029,if(t<=374,0.00283053906,if(t<=375,0.00324595184,if(t<=376,0.00288717874,if(t<=377,0.00276439946,if(t<=378,0.00244384282,if(t<=379,0.00233597338,if(t<=380,0.00279352064,if(t<=381,0.00286037951,if(t<=382,0.00328170603,if(t<=383,0.002822949,if(t<=384,0.00278954494,if(t<=385,0.00312619711,if(t<=386,0.00324124337,if(t<=387,0.00365400495,if(t<=388,0.00402022148,if(t<=389,0.00451327855,if(t<=390,0.00463343495,if(t<=391,0.00361972256,if(t<=392,0.00421404306,if(t<=393,0.00450737728,if(t<=394,0.00385689985,if(t<=395,0.00706347035,if(t<=396,0.00548992622,if(t<=397,0.00561269851,if(t<=398,0.00565157042,if(t<=399,0.00465943143,if(t<=400,0.00360607661,if(t<=401,0.00424833829,if(t<=402,0.00506165543,if(t<=403,0.00554584679,if(t<=404,0.00567074572,if(t<=405,0.00521791533,if(t<=406,0.00511027778,if(t<=407,0.00463445002,if(t<=408,0.0048334687,if(t<=409,0.00495195688,if(t<=410,0.00549367799,if(t<=411,0.00563900702,if(t<=412,0.00467717288,if(t<=413,0.00464379518,if(t<=414,0.00459904476,if(t<=415,0.00454237307,if(t<=416,0.00500574242,if(t<=417,0.00531713904,if(t<=418,0.00561133477,if(t<=419,0.00533865191,if(t<=420,0.00495078846,if(t<=421,0.00463678844,if(t<=422,0.00473844747,if(t<=423,0.0054393895,if(t<=424,0.00545525246,if(t<=425,0.00541193326,if(t<=426,0.00509452208,if(t<=427,0.00660187229,if(t<=428,0.00417453135,if(t<=429,0.00467057068,if(t<=430,0.00516133914,if(t<=431,0.00579060434,if(t<=432,0.00527368183,if(t<=433,0.0046510559,if(t<=434,0.00430932033,if(t<=435,0.00469632041,if(t<=436,0.00451319727,if(t<=437,0.00525834823,if(t<=438,0.00514407899,if(t<=439,0.00424489032,if(t<=440,0.00338261955,if(t<=441,0.0038480963,if(t<=442,0.00292950561,if(t<=443,0.00356221514,if(t<=444,0.00426978001,if(t<=445,0.00498272013,if(t<=446,0.00406037155,if(t<=447,0.00385850101,if(t<=448,0.00311324383,if(t<=449,0.00287080426,if(t<=450,0.00249969302,if(t<=451,0.00303688666,if(t<=452,0.00373753143,if(t<=453,0.00334610566,if(t<=454,0.00271933283,if(t<=455,0.00249564984,if(t<=456,0.00211065932,if(t<=457,0.0026296495,if(t<=458,0.002927413,if(t<=459,0.00348787669,if(t<=460,0.00360563614,if(t<=461,0.00305593177,if(t<=462,0.0029747901,if(t<=463,0.00313546965,if(t<=464,0.00427331421,if(t<=465,0.00367859101,if(t<=466,0.0038757078,if(t<=467,0.00345077,if(t<=468,0.00294496232,if(t<=469,0.00280944761,if(t<=470,0.00320988109,if(t<=471,0.00327554366,if(t<=472,0.00291552997,if(t<=473,0.00379463693,if(t<=474,0.00296006542,if(t<=475,0.00296144959,if(t<=476,0.00226444315,if(t<=477,0.00222587449,if(t<=478,0.00208900522,if(t<=479,0.00235789914,if(t<=480,0.0023527227,if(t<=481,0.00225757636,if(t<=482,0.00156006694,if(t<=483,0.00200007592,if(t<=484,0.00177305229,if(t<=485,0.00132721137,if(t<=486,0.0016157386,if(t<=487,0.00160173321,if(t<=488,0.00161771581,if(t<=489,0.00120030271,if(t<=490,0.00106073605,if(t<=491,0.00109226802,if(t<=492,0.0009426437350000001,if(t<=493,0.00129775163,if(t<=494,0.00148914411,if(t<=495,0.00126664783,if(t<=496,0.00111729785,if(t<=497,0.000928262283,if(t<=498,0.00100128739,if(t<=499,0.000862123754,if(t<=500,0.00143578505,if(t<=501,0.00159369446,if(t<=502,0.001236268,if(t<=503,0.0010974177,if(t<=504,0.00116777929,if(t<=505,0.00129901145,if(t<=506,0.00143993669,if(t<=507,0.00137057727,if(t<=508,0.00129378217,if(t<=509,0.00105560763,if(t<=510,0.00076959134,if(t<=511,0.00100224246,if(t<=512,0.00126489835,if(t<=513,0.000839568459,if(t<=514,0.00104061086,if(t<=515,0.0012489978,if(t<=516,0.000909710251,if(t<=517,0.00106807397,if(t<=518,0.00092042926,if(t<=519,0.000568671374,if(t<=520,0.00107534612,if(t<=521,0.000977098888,if(t<=522,0.0011913604,if(t<=523,0.0020660573,if(t<=524,0.000776079056,if(t<=525,0.0009384054229999999,if(t<=526,0.0007691787249999999,if(t<=527,0.0008221690370000001,if(t<=528,0.000977691101,if(t<=529,0.00120703073,if(t<=530,0.00115212883,if(t<=531,0.0009606733930000001,if(t<=532,0.00093316483,if(t<=533,0.0007720669550000001,if(t<=534,0.00120225262,if(t<=535,0.0011870245,if(t<=536,0.00108866938,if(t<=537,0.0009816442539999999,if(t<=538,0.0013641676,if(t<=539,0.000946980045,if(t<=540,0.0009865161470000001,if(t<=541,0.00106015651,if(t<=542,0.0011457813,if(t<=543,0.00126624345,if(t<=544,0.00136449029,if(t<=545,0.00102888928,if(t<=546,0.000864759508,if(t<=547,0.0011350614,if(t<=548,0.00094079968,if(t<=549,0.00106408062,if(t<=550,0.00155375609,if(t<=551,0.000838952779,if(t<=552,0.00106263742,if(t<=553,0.00118428894,if(t<=554,0.000855891218,if(t<=555,0.000815682206,if(t<=556,0.00102089848,if(t<=557,0.00110255282,if(t<=558,0.00113035448,if(t<=559,0.00102012975,if(t<=560,0.00110705653,if(t<=561,0.000705581016,if(t<=562,0.000993763855,if(t<=563,0.00118845612,if(t<=564,0.00117255526,if(t<=565,0.000896920008,if(t<=566,0.00116252977,if(t<=567,0.0009774145669999999,if(t<=568,0.000774332103,if(t<=569,0.00102867561,if(t<=570,0.000824192259,if(t<=571,0.000945787156,if(t<=572,0.000867970103,if(t<=573,0.000975609124,if(t<=574,0.0009400845809999999,if(t<=575,0.000798736412,if(t<=576,0.000715158278,if(t<=577,0.000796893693,if(t<=578,0.000646695582,if(t<=579,0.000983652225,if(t<=580,0.000844168204,if(t<=581,0.000706883968,if(t<=582,0.00075490277,if(t<=583,0.000968707132,if(t<=584,0.000823652744,if(t<=585,0.000913533955,if(t<=586,0.000758321971,if(t<=587,0.000722756758,if(t<=588,0.000708912186,if(t<=589,0.000814718917,if(t<=590,0.000692181581,if(t<=591,0.000874866316,if(t<=592,0.000687077945,if(t<=593,0.00101249691,if(t<=594,0.000789045455,if(t<=595,0.000773614795,if(t<=596,0.000526705332,if(t<=597,0.000706965066,if(t<=598,0.000903633251,if(t<=599,0.000590024411,if(t<=600,0.000936203932,if(t<=601,0.000607883075,if(t<=602,0.000564723531,if(t<=603,0.000724888451,if(t<=604,0.00068726425,if(t<=605,0.000555183276,if(t<=606,0.000856091978,if(t<=607,0.000576251369,if(t<=608,0.0009014603059999999,if(t<=609,0.000536780404,if(t<=610,0.0006876480990000001,if(t<=611,0.000371006631,if(t<=612,0.000692669203,if(t<=613,0.00083516197,if(t<=614,0.00038463401,if(t<=615,0.000800101713,if(t<=616,0.000375803641,if(t<=617,0.0006264554589999999,if(t<=618,0.000526031526,if(t<=619,0.000499368607,if(t<=620,0.000428305584,if(t<=621,0.000909464485,if(t<=622,0.000351236661,if(t<=623,0.000566571376,if(t<=624,0.000429427975,if(t<=625,0.000499533864,if(t<=626,0.000526757148,if(t<=627,0.000225809721,if(t<=628,0.0005403013610000001,if(t<=629,0.000240458659,if(t<=630,0.000516079477,if(t<=631,0.000660882077,if(t<=632,0.000566899036,if(t<=633,0.00115467547,if(t<=634,0.000633427116,if(t<=635,0.000518385602,if(t<=636,0.000749428245,if(t<=637,0.000913122119,if(t<=638,0.000786391348,if(t<=639,0.0012730781,if(t<=640,0.00129256234,if(t<=641,0.00115637457,if(t<=642,0.00102572807,if(t<=643,0.00105539285,if(t<=644,0.00119078863,if(t<=645,0.000732476407,if(t<=646,0.0011368034,if(t<=647,0.00143053847,if(t<=648,0.000947157648,if(t<=649,0.00133587678,0)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
+#v_rate() 1e4*if(t<=297,1e-6,if(t<=298,1.12314383e-05,if(t<=299,9.94451901e-06,if(t<=300,4.74735912e-05,if(t<=301,2.11759573e-05,if(t<=302,0,if(t<=303,8.68001985e-05,if(t<=304,3.62421529e-05,if(t<=305,8.93918412e-05,if(t<=306,0.000146015146,if(t<=307,0.00010497702,if(t<=308,7.94473222e-05,if(t<=309,6.05025646e-05,if(t<=310,0.000364352105,if(t<=311,0.000201739564,if(t<=312,0.000357759509,if(t<=313,0.000269842203,if(t<=314,0.000257166618,if(t<=315,0.000470011593,if(t<=316,0.000451941228,if(t<=317,0.000253944211,if(t<=318,0.0006239742879999999,if(t<=319,0.00066809744,if(t<=320,0.000499101616,if(t<=321,0.000321104073,if(t<=322,0.000519506807,if(t<=323,0.000424076528,if(t<=324,0.000449397629,if(t<=325,0.000884025501,if(t<=326,0.000654416186,if(t<=327,0.00064374717,if(t<=328,0.000789273122,if(t<=329,0.000803543557,if(t<=330,0.000638530434,if(t<=331,0.00100160898,if(t<=332,0.000993807258,if(t<=333,0.00124114925,if(t<=334,0.00123426412,if(t<=335,0.00141321826,if(t<=336,0.00118332628,if(t<=337,0.00109470055,if(t<=338,0.00125019427,if(t<=339,0.00135455371,if(t<=340,0.0019431852,if(t<=341,0.00205543168,if(t<=342,0.00197207562,if(t<=343,0.0022614449,if(t<=344,0.00211490243,if(t<=345,0.00210695833,if(t<=346,0.00249495193,if(t<=347,0.00234941068,if(t<=348,0.00226462926,if(t<=349,0.00192793935,if(t<=350,0.002307822,if(t<=351,0.00177314607,if(t<=352,0.00204756246,if(t<=353,0.00223537455,if(t<=354,0.00265125171,if(t<=355,0.00215845046,if(t<=356,0.00219770402,if(t<=357,0.00178428238,if(t<=358,0.00184590186,if(t<=359,0.0018605743,if(t<=360,0.00184659497,if(t<=361,0.00229017668,if(t<=362,0.00253196493,if(t<=363,0.00239098899,if(t<=364,0.00211185421,if(t<=365,0.00219407719,if(t<=366,0.00212246707,if(t<=367,0.00269861999,if(t<=368,0.00266277044,if(t<=369,0.0022864101,if(t<=370,0.00238106143,if(t<=371,0.00288706782,if(t<=372,0.00241887213,if(t<=373,0.00264944029,if(t<=374,0.00283053906,if(t<=375,0.00324595184,if(t<=376,0.00288717874,if(t<=377,0.00276439946,if(t<=378,0.00244384282,if(t<=379,0.00233597338,if(t<=380,0.00279352064,if(t<=381,0.00286037951,if(t<=382,0.00328170603,if(t<=383,0.002822949,if(t<=384,0.00278954494,if(t<=385,0.00312619711,if(t<=386,0.00324124337,if(t<=387,0.00365400495,if(t<=388,0.00402022148,if(t<=389,0.00451327855,if(t<=390,0.00463343495,if(t<=391,0.00361972256,if(t<=392,0.00421404306,if(t<=393,0.00450737728,if(t<=394,0.00385689985,if(t<=395,0.00706347035,if(t<=396,0.00548992622,if(t<=397,0.00561269851,if(t<=398,0.00565157042,if(t<=399,0.00465943143,if(t<=400,0.00360607661,if(t<=401,0.00424833829,if(t<=402,0.00506165543,if(t<=403,0.00554584679,if(t<=404,0.00567074572,if(t<=405,0.00521791533,if(t<=406,0.00511027778,if(t<=407,0.00463445002,if(t<=408,0.0048334687,if(t<=409,0.00495195688,if(t<=410,0.00549367799,if(t<=411,0.00563900702,if(t<=412,0.00467717288,if(t<=413,0.00464379518,if(t<=414,0.00459904476,if(t<=415,0.00454237307,if(t<=416,0.00500574242,if(t<=417,0.00531713904,if(t<=418,0.00561133477,if(t<=419,0.00533865191,if(t<=420,0.00495078846,if(t<=421,0.00463678844,if(t<=422,0.00473844747,if(t<=423,0.0054393895,if(t<=424,0.00545525246,if(t<=425,0.00541193326,if(t<=426,0.00509452208,if(t<=427,0.00660187229,if(t<=428,0.00417453135,if(t<=429,0.00467057068,if(t<=430,0.00516133914,if(t<=431,0.00579060434,if(t<=432,0.00527368183,if(t<=433,0.0046510559,if(t<=434,0.00430932033,if(t<=435,0.00469632041,if(t<=436,0.00451319727,if(t<=437,0.00525834823,if(t<=438,0.00514407899,if(t<=439,0.00424489032,if(t<=440,0.00338261955,if(t<=441,0.0038480963,if(t<=442,0.00292950561,if(t<=443,0.00356221514,if(t<=444,0.00426978001,if(t<=445,0.00498272013,if(t<=446,0.00406037155,if(t<=447,0.00385850101,if(t<=448,0.00311324383,if(t<=449,0.00287080426,if(t<=450,0.00249969302,if(t<=451,0.00303688666,if(t<=452,0.00373753143,if(t<=453,0.00334610566,if(t<=454,0.00271933283,if(t<=455,0.00249564984,if(t<=456,0.00211065932,if(t<=457,0.0026296495,if(t<=458,0.002927413,if(t<=459,0.00348787669,if(t<=460,0.00360563614,if(t<=461,0.00305593177,if(t<=462,0.0029747901,if(t<=463,0.00313546965,if(t<=464,0.00427331421,if(t<=465,0.00367859101,if(t<=466,0.0038757078,if(t<=467,0.00345077,if(t<=468,0.00294496232,if(t<=469,0.00280944761,if(t<=470,0.00320988109,if(t<=471,0.00327554366,if(t<=472,0.00291552997,if(t<=473,0.00379463693,if(t<=474,0.00296006542,if(t<=475,0.00296144959,if(t<=476,0.00226444315,if(t<=477,0.00222587449,if(t<=478,0.00208900522,if(t<=479,0.00235789914,if(t<=480,0.0023527227,if(t<=481,0.00225757636,if(t<=482,0.00156006694,if(t<=483,0.00200007592,if(t<=484,0.00177305229,if(t<=485,0.00132721137,if(t<=486,0.0016157386,if(t<=487,0.00160173321,if(t<=488,0.00161771581,if(t<=489,0.00120030271,if(t<=490,0.00106073605,if(t<=491,0.00109226802,if(t<=492,0.0009426437350000001,if(t<=493,0.00129775163,if(t<=494,0.00148914411,if(t<=495,0.00126664783,if(t<=496,0.00111729785,if(t<=497,0.000928262283,if(t<=498,0.00100128739,if(t<=499,0.000862123754,if(t<=500,0.00143578505,if(t<=501,0.00159369446,if(t<=502,0.001236268,if(t<=503,0.0010974177,if(t<=504,0.00116777929,if(t<=505,0.00129901145,if(t<=506,0.00143993669,if(t<=507,0.00137057727,if(t<=508,0.00129378217,if(t<=509,0.00105560763,if(t<=510,0.00076959134,if(t<=511,0.00100224246,if(t<=512,0.00126489835,if(t<=513,0.000839568459,if(t<=514,0.00104061086,if(t<=515,0.0012489978,if(t<=516,0.000909710251,if(t<=517,0.00106807397,if(t<=518,0.00092042926,if(t<=519,0.000568671374,if(t<=520,0.00107534612,if(t<=521,0.000977098888,if(t<=522,0.0011913604,if(t<=523,0.0020660573,if(t<=524,0.000776079056,if(t<=525,0.0009384054229999999,if(t<=526,0.0007691787249999999,if(t<=527,0.0008221690370000001,if(t<=528,0.000977691101,if(t<=529,0.00120703073,if(t<=530,0.00115212883,if(t<=531,0.0009606733930000001,if(t<=532,0.00093316483,if(t<=533,0.0007720669550000001,if(t<=534,0.00120225262,if(t<=535,0.0011870245,if(t<=536,0.00108866938,if(t<=537,0.0009816442539999999,if(t<=538,0.0013641676,if(t<=539,0.000946980045,if(t<=540,0.0009865161470000001,if(t<=541,0.00106015651,if(t<=542,0.0011457813,if(t<=543,0.00126624345,if(t<=544,0.00136449029,if(t<=545,0.00102888928,if(t<=546,0.000864759508,if(t<=547,0.0011350614,if(t<=548,0.00094079968,if(t<=549,0.00106408062,if(t<=550,0.00155375609,if(t<=551,0.000838952779,if(t<=552,0.00106263742,if(t<=553,0.00118428894,if(t<=554,0.000855891218,if(t<=555,0.000815682206,if(t<=556,0.00102089848,if(t<=557,0.00110255282,if(t<=558,0.00113035448,if(t<=559,0.00102012975,if(t<=560,0.00110705653,if(t<=561,0.000705581016,if(t<=562,0.000993763855,if(t<=563,0.00118845612,if(t<=564,0.00117255526,if(t<=565,0.000896920008,if(t<=566,0.00116252977,if(t<=567,0.0009774145669999999,if(t<=568,0.000774332103,if(t<=569,0.00102867561,if(t<=570,0.000824192259,if(t<=571,0.000945787156,if(t<=572,0.000867970103,if(t<=573,0.000975609124,if(t<=574,0.0009400845809999999,if(t<=575,0.000798736412,if(t<=576,0.000715158278,if(t<=577,0.000796893693,if(t<=578,0.000646695582,if(t<=579,0.000983652225,if(t<=580,0.000844168204,if(t<=581,0.000706883968,if(t<=582,0.00075490277,if(t<=583,0.000968707132,if(t<=584,0.000823652744,if(t<=585,0.000913533955,if(t<=586,0.000758321971,if(t<=587,0.000722756758,if(t<=588,0.000708912186,if(t<=589,0.000814718917,if(t<=590,0.000692181581,if(t<=591,0.000874866316,if(t<=592,0.000687077945,if(t<=593,0.00101249691,if(t<=594,0.000789045455,if(t<=595,0.000773614795,if(t<=596,0.000526705332,if(t<=597,0.000706965066,if(t<=598,0.000903633251,if(t<=599,0.000590024411,if(t<=600,0.000936203932,if(t<=601,0.000607883075,if(t<=602,0.000564723531,if(t<=603,0.000724888451,if(t<=604,0.00068726425,if(t<=605,0.000555183276,if(t<=606,0.000856091978,if(t<=607,0.000576251369,if(t<=608,0.0009014603059999999,if(t<=609,0.000536780404,if(t<=610,0.0006876480990000001,if(t<=611,0.000371006631,if(t<=612,0.000692669203,if(t<=613,0.00083516197,if(t<=614,0.00038463401,if(t<=615,0.000800101713,if(t<=616,0.000375803641,if(t<=617,0.0006264554589999999,if(t<=618,0.000526031526,if(t<=619,0.000499368607,if(t<=620,0.000428305584,if(t<=621,0.000909464485,if(t<=622,0.000351236661,if(t<=623,0.000566571376,if(t<=624,0.000429427975,if(t<=625,0.000499533864,if(t<=626,0.000526757148,if(t<=627,0.000225809721,if(t<=628,0.0005403013610000001,if(t<=629,0.000240458659,if(t<=630,0.000516079477,if(t<=631,0.000660882077,if(t<=632,0.000566899036,if(t<=633,0.00115467547,if(t<=634,0.000633427116,if(t<=635,0.000518385602,if(t<=636,0.000749428245,if(t<=637,0.000913122119,if(t<=638,0.000786391348,if(t<=639,0.0012730781,if(t<=640,0.00129256234,if(t<=641,0.00115637457,if(t<=642,0.00102572807,if(t<=643,0.00105539285,if(t<=644,0.00119078863,if(t<=645,0.000732476407,if(t<=646,0.0011368034,if(t<=647,0.00143053847,if(t<=648,0.000947157648,if(t<=649,0.00133587678,0)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
+end functions
+begin reaction rules
+# timer
+0->counter() 1
+0->V() v_rate()
+end reaction rules
+end model
+
+#generate_network({overwrite=>1})
+#simulate({suffix=>"ODE",method=>"ode",t_start=>0,t_end=>1000,n_steps=>1000,print_functions=>1}) # works for cases 1 and 2
+#simulate({suffix=>"SSA",method=>"ssa",t_start=>0,t_end=>1000,n_steps=>1000,seed=>1,print_functions=>1}) # works for cases 1 and 2
+
+simulate({suffix=>"NF",method=>"nf",t_start=>0,t_end=>1000,n_steps=>1000,seed=>1,print_functions=>1}) # works for case 1, fails for case 2
diff --git a/Issues/nestedIF/BillsTest/2024_05_09__17_36_20/BillsTest.bngl b/Issues/nestedIF/BillsTest/2024_05_09__17_36_20/BillsTest.bngl
new file mode 100644
index 00000000..bfd5dabf
--- /dev/null
+++ b/Issues/nestedIF/BillsTest/2024_05_09__17_36_20/BillsTest.bngl
@@ -0,0 +1,38 @@
+begin model
+# example of NFsim error caused by too deep nesting of if-then-else
+statements in function definition
+
+begin molecule types
+V()
+counter()
+end molecule types
+
+begin seed species
+V() 0
+counter() 0
+end seed species
+
+begin observables
+Molecules t counter()
+Molecules V V()
+end observables
+
+begin functions
+# CASE 1: constant rate
+#v_rate()=1e-6
+# CASE 2: variable rate defined in terms of nested if-then-else statements
+v_rate() 1e4*if(t<=297,1e-6,if(t<=298,1.12314383e-05,if(t<=299,9.94451901e-06,if(t<=300,4.74735912e-05,if(t<=301,2.11759573e-05,0)))))
+#v_rate() 1e4*if(t<=297,1e-6,if(t<=298,1.12314383e-05,if(t<=299,9.94451901e-06,if(t<=300,4.74735912e-05,if(t<=301,2.11759573e-05,if(t<=302,0,if(t<=303,8.68001985e-05,if(t<=304,3.62421529e-05,if(t<=305,8.93918412e-05,if(t<=306,0.000146015146,if(t<=307,0.00010497702,if(t<=308,7.94473222e-05,if(t<=309,6.05025646e-05,if(t<=310,0.000364352105,if(t<=311,0.000201739564,if(t<=312,0.000357759509,if(t<=313,0.000269842203,if(t<=314,0.000257166618,if(t<=315,0.000470011593,if(t<=316,0.000451941228,if(t<=317,0.000253944211,if(t<=318,0.0006239742879999999,if(t<=319,0.00066809744,if(t<=320,0.000499101616,if(t<=321,0.000321104073,if(t<=322,0.000519506807,if(t<=323,0.000424076528,if(t<=324,0.000449397629,if(t<=325,0.000884025501,if(t<=326,0.000654416186,if(t<=327,0.00064374717,if(t<=328,0.000789273122,if(t<=329,0.000803543557,if(t<=330,0.000638530434,if(t<=331,0.00100160898,if(t<=332,0.000993807258,if(t<=333,0.00124114925,if(t<=334,0.00123426412,if(t<=335,0.00141321826,if(t<=336,0.00118332628,if(t<=337,0.00109470055,if(t<=338,0.00125019427,if(t<=339,0.00135455371,if(t<=340,0.0019431852,if(t<=341,0.00205543168,if(t<=342,0.00197207562,if(t<=343,0.0022614449,if(t<=344,0.00211490243,if(t<=345,0.00210695833,if(t<=346,0.00249495193,if(t<=347,0.00234941068,if(t<=348,0.00226462926,if(t<=349,0.00192793935,if(t<=350,0.002307822,if(t<=351,0.00177314607,if(t<=352,0.00204756246,if(t<=353,0.00223537455,if(t<=354,0.00265125171,if(t<=355,0.00215845046,if(t<=356,0.00219770402,if(t<=357,0.00178428238,if(t<=358,0.00184590186,if(t<=359,0.0018605743,if(t<=360,0.00184659497,if(t<=361,0.00229017668,if(t<=362,0.00253196493,if(t<=363,0.00239098899,if(t<=364,0.00211185421,if(t<=365,0.00219407719,if(t<=366,0.00212246707,if(t<=367,0.00269861999,if(t<=368,0.00266277044,if(t<=369,0.0022864101,if(t<=370,0.00238106143,if(t<=371,0.00288706782,if(t<=372,0.00241887213,if(t<=373,0.00264944029,if(t<=374,0.00283053906,if(t<=375,0.00324595184,if(t<=376,0.00288717874,if(t<=377,0.00276439946,if(t<=378,0.00244384282,if(t<=379,0.00233597338,if(t<=380,0.00279352064,if(t<=381,0.00286037951,if(t<=382,0.00328170603,if(t<=383,0.002822949,if(t<=384,0.00278954494,if(t<=385,0.00312619711,if(t<=386,0.00324124337,if(t<=387,0.00365400495,if(t<=388,0.00402022148,if(t<=389,0.00451327855,if(t<=390,0.00463343495,if(t<=391,0.00361972256,if(t<=392,0.00421404306,if(t<=393,0.00450737728,if(t<=394,0.00385689985,if(t<=395,0.00706347035,if(t<=396,0.00548992622,if(t<=397,0.00561269851,if(t<=398,0.00565157042,if(t<=399,0.00465943143,if(t<=400,0.00360607661,if(t<=401,0.00424833829,if(t<=402,0.00506165543,if(t<=403,0.00554584679,if(t<=404,0.00567074572,if(t<=405,0.00521791533,if(t<=406,0.00511027778,if(t<=407,0.00463445002,if(t<=408,0.0048334687,if(t<=409,0.00495195688,if(t<=410,0.00549367799,if(t<=411,0.00563900702,if(t<=412,0.00467717288,if(t<=413,0.00464379518,if(t<=414,0.00459904476,if(t<=415,0.00454237307,if(t<=416,0.00500574242,if(t<=417,0.00531713904,if(t<=418,0.00561133477,if(t<=419,0.00533865191,if(t<=420,0.00495078846,if(t<=421,0.00463678844,if(t<=422,0.00473844747,if(t<=423,0.0054393895,if(t<=424,0.00545525246,if(t<=425,0.00541193326,if(t<=426,0.00509452208,if(t<=427,0.00660187229,if(t<=428,0.00417453135,if(t<=429,0.00467057068,if(t<=430,0.00516133914,if(t<=431,0.00579060434,if(t<=432,0.00527368183,if(t<=433,0.0046510559,if(t<=434,0.00430932033,if(t<=435,0.00469632041,if(t<=436,0.00451319727,if(t<=437,0.00525834823,if(t<=438,0.00514407899,if(t<=439,0.00424489032,if(t<=440,0.00338261955,if(t<=441,0.0038480963,if(t<=442,0.00292950561,if(t<=443,0.00356221514,if(t<=444,0.00426978001,if(t<=445,0.00498272013,if(t<=446,0.00406037155,if(t<=447,0.00385850101,if(t<=448,0.00311324383,if(t<=449,0.00287080426,if(t<=450,0.00249969302,if(t<=451,0.00303688666,if(t<=452,0.00373753143,if(t<=453,0.00334610566,if(t<=454,0.00271933283,if(t<=455,0.00249564984,if(t<=456,0.00211065932,if(t<=457,0.0026296495,if(t<=458,0.002927413,if(t<=459,0.00348787669,if(t<=460,0.00360563614,if(t<=461,0.00305593177,if(t<=462,0.0029747901,if(t<=463,0.00313546965,if(t<=464,0.00427331421,if(t<=465,0.00367859101,if(t<=466,0.0038757078,if(t<=467,0.00345077,if(t<=468,0.00294496232,if(t<=469,0.00280944761,if(t<=470,0.00320988109,if(t<=471,0.00327554366,if(t<=472,0.00291552997,if(t<=473,0.00379463693,if(t<=474,0.00296006542,if(t<=475,0.00296144959,if(t<=476,0.00226444315,if(t<=477,0.00222587449,if(t<=478,0.00208900522,if(t<=479,0.00235789914,if(t<=480,0.0023527227,if(t<=481,0.00225757636,if(t<=482,0.00156006694,if(t<=483,0.00200007592,if(t<=484,0.00177305229,if(t<=485,0.00132721137,if(t<=486,0.0016157386,if(t<=487,0.00160173321,if(t<=488,0.00161771581,if(t<=489,0.00120030271,if(t<=490,0.00106073605,if(t<=491,0.00109226802,if(t<=492,0.0009426437350000001,if(t<=493,0.00129775163,if(t<=494,0.00148914411,if(t<=495,0.00126664783,if(t<=496,0.00111729785,if(t<=497,0.000928262283,if(t<=498,0.00100128739,if(t<=499,0.000862123754,if(t<=500,0.00143578505,if(t<=501,0.00159369446,if(t<=502,0.001236268,if(t<=503,0.0010974177,if(t<=504,0.00116777929,if(t<=505,0.00129901145,if(t<=506,0.00143993669,if(t<=507,0.00137057727,if(t<=508,0.00129378217,if(t<=509,0.00105560763,if(t<=510,0.00076959134,if(t<=511,0.00100224246,if(t<=512,0.00126489835,if(t<=513,0.000839568459,if(t<=514,0.00104061086,if(t<=515,0.0012489978,if(t<=516,0.000909710251,if(t<=517,0.00106807397,if(t<=518,0.00092042926,if(t<=519,0.000568671374,if(t<=520,0.00107534612,if(t<=521,0.000977098888,if(t<=522,0.0011913604,if(t<=523,0.0020660573,if(t<=524,0.000776079056,if(t<=525,0.0009384054229999999,if(t<=526,0.0007691787249999999,if(t<=527,0.0008221690370000001,if(t<=528,0.000977691101,if(t<=529,0.00120703073,if(t<=530,0.00115212883,if(t<=531,0.0009606733930000001,if(t<=532,0.00093316483,if(t<=533,0.0007720669550000001,if(t<=534,0.00120225262,if(t<=535,0.0011870245,if(t<=536,0.00108866938,if(t<=537,0.0009816442539999999,if(t<=538,0.0013641676,if(t<=539,0.000946980045,if(t<=540,0.0009865161470000001,if(t<=541,0.00106015651,if(t<=542,0.0011457813,if(t<=543,0.00126624345,if(t<=544,0.00136449029,if(t<=545,0.00102888928,if(t<=546,0.000864759508,if(t<=547,0.0011350614,if(t<=548,0.00094079968,if(t<=549,0.00106408062,if(t<=550,0.00155375609,if(t<=551,0.000838952779,if(t<=552,0.00106263742,if(t<=553,0.00118428894,if(t<=554,0.000855891218,if(t<=555,0.000815682206,if(t<=556,0.00102089848,if(t<=557,0.00110255282,if(t<=558,0.00113035448,if(t<=559,0.00102012975,if(t<=560,0.00110705653,if(t<=561,0.000705581016,if(t<=562,0.000993763855,if(t<=563,0.00118845612,if(t<=564,0.00117255526,if(t<=565,0.000896920008,if(t<=566,0.00116252977,if(t<=567,0.0009774145669999999,if(t<=568,0.000774332103,if(t<=569,0.00102867561,if(t<=570,0.000824192259,if(t<=571,0.000945787156,if(t<=572,0.000867970103,if(t<=573,0.000975609124,if(t<=574,0.0009400845809999999,if(t<=575,0.000798736412,if(t<=576,0.000715158278,if(t<=577,0.000796893693,if(t<=578,0.000646695582,if(t<=579,0.000983652225,if(t<=580,0.000844168204,if(t<=581,0.000706883968,if(t<=582,0.00075490277,if(t<=583,0.000968707132,if(t<=584,0.000823652744,if(t<=585,0.000913533955,if(t<=586,0.000758321971,if(t<=587,0.000722756758,if(t<=588,0.000708912186,if(t<=589,0.000814718917,if(t<=590,0.000692181581,if(t<=591,0.000874866316,if(t<=592,0.000687077945,if(t<=593,0.00101249691,if(t<=594,0.000789045455,if(t<=595,0.000773614795,if(t<=596,0.000526705332,if(t<=597,0.000706965066,if(t<=598,0.000903633251,if(t<=599,0.000590024411,if(t<=600,0.000936203932,if(t<=601,0.000607883075,if(t<=602,0.000564723531,if(t<=603,0.000724888451,if(t<=604,0.00068726425,if(t<=605,0.000555183276,if(t<=606,0.000856091978,if(t<=607,0.000576251369,if(t<=608,0.0009014603059999999,if(t<=609,0.000536780404,if(t<=610,0.0006876480990000001,if(t<=611,0.000371006631,if(t<=612,0.000692669203,if(t<=613,0.00083516197,if(t<=614,0.00038463401,if(t<=615,0.000800101713,if(t<=616,0.000375803641,if(t<=617,0.0006264554589999999,if(t<=618,0.000526031526,if(t<=619,0.000499368607,if(t<=620,0.000428305584,if(t<=621,0.000909464485,if(t<=622,0.000351236661,if(t<=623,0.000566571376,if(t<=624,0.000429427975,if(t<=625,0.000499533864,if(t<=626,0.000526757148,if(t<=627,0.000225809721,if(t<=628,0.0005403013610000001,if(t<=629,0.000240458659,if(t<=630,0.000516079477,if(t<=631,0.000660882077,if(t<=632,0.000566899036,if(t<=633,0.00115467547,if(t<=634,0.000633427116,if(t<=635,0.000518385602,if(t<=636,0.000749428245,if(t<=637,0.000913122119,if(t<=638,0.000786391348,if(t<=639,0.0012730781,if(t<=640,0.00129256234,if(t<=641,0.00115637457,if(t<=642,0.00102572807,if(t<=643,0.00105539285,if(t<=644,0.00119078863,if(t<=645,0.000732476407,if(t<=646,0.0011368034,if(t<=647,0.00143053847,if(t<=648,0.000947157648,if(t<=649,0.00133587678,0)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
+end functions
+begin reaction rules
+# timer
+0->counter() 1
+0->V() v_rate()
+end reaction rules
+end model
+
+#generate_network({overwrite=>1})
+#simulate({suffix=>"ODE",method=>"ode",t_start=>0,t_end=>1000,n_steps=>1000,print_functions=>1}) # works for cases 1 and 2
+#simulate({suffix=>"SSA",method=>"ssa",t_start=>0,t_end=>1000,n_steps=>1000,print_functions=>1}) # works for cases 1 and 2
+
+simulate({suffix=>"NF",method=>"nf",t_start=>0,t_end=>1000,n_steps=>1000,seed=>1,print_functions=>1}) # works for case 1, fails for case 2
diff --git a/Issues/nestedIF/BillsTest/2024_05_09__17_36_20/BillsTest_NF.species b/Issues/nestedIF/BillsTest/2024_05_09__17_36_20/BillsTest_NF.species
new file mode 100644
index 00000000..14040562
--- /dev/null
+++ b/Issues/nestedIF/BillsTest/2024_05_09__17_36_20/BillsTest_NF.species
@@ -0,0 +1,4 @@
+# nfsim generated species list for system: 'BillsTest'
+# warning! this feature is not yet fully tested!
+V() 2
+counter() 973
diff --git a/Issues/nestedIF/BillsTest/2024_05_09__17_36_20/BillsTest_NF.xml b/Issues/nestedIF/BillsTest/2024_05_09__17_36_20/BillsTest_NF.xml
new file mode 100644
index 00000000..353c8460
--- /dev/null
+++ b/Issues/nestedIF/BillsTest/2024_05_09__17_36_20/BillsTest_NF.xml
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1e4*if((t<297),1e-6,if((t<=298),1.12314383e-05,if((t<=299),9.94451901e-06,if((t<=300),4.74735912e-05,if((t<=301),2.11759573e-05,0)))))
+
+
+
+
diff --git a/Issues/nestedIF/BillsTest/2024_05_09__17_37_20/BillsTest.bngl b/Issues/nestedIF/BillsTest/2024_05_09__17_37_20/BillsTest.bngl
new file mode 100644
index 00000000..820c4939
--- /dev/null
+++ b/Issues/nestedIF/BillsTest/2024_05_09__17_37_20/BillsTest.bngl
@@ -0,0 +1,38 @@
+begin model
+# example of NFsim error caused by too deep nesting of if-then-else
+statements in function definition
+
+begin molecule types
+V()
+counter()
+end molecule types
+
+begin seed species
+V() 0
+counter() 0
+end seed species
+
+begin observables
+Molecules t counter()
+Molecules V V()
+end observables
+
+begin functions
+# CASE 1: constant rate
+#v_rate()=1e-6
+# CASE 2: variable rate defined in terms of nested if-then-else statements
+v_rate() 1e4*if(t<=297,1e-6,if(t<=298,1.12314383e-05,if(t<=299,9.94451901e-06,if(t<=300,4.74735912e-05,if(t<=301,2.11759573e-05,0)))))
+#v_rate() 1e4*if(t<=297,1e-6,if(t<=298,1.12314383e-05,if(t<=299,9.94451901e-06,if(t<=300,4.74735912e-05,if(t<=301,2.11759573e-05,if(t<=302,0,if(t<=303,8.68001985e-05,if(t<=304,3.62421529e-05,if(t<=305,8.93918412e-05,if(t<=306,0.000146015146,if(t<=307,0.00010497702,if(t<=308,7.94473222e-05,if(t<=309,6.05025646e-05,if(t<=310,0.000364352105,if(t<=311,0.000201739564,if(t<=312,0.000357759509,if(t<=313,0.000269842203,if(t<=314,0.000257166618,if(t<=315,0.000470011593,if(t<=316,0.000451941228,if(t<=317,0.000253944211,if(t<=318,0.0006239742879999999,if(t<=319,0.00066809744,if(t<=320,0.000499101616,if(t<=321,0.000321104073,if(t<=322,0.000519506807,if(t<=323,0.000424076528,if(t<=324,0.000449397629,if(t<=325,0.000884025501,if(t<=326,0.000654416186,if(t<=327,0.00064374717,if(t<=328,0.000789273122,if(t<=329,0.000803543557,if(t<=330,0.000638530434,if(t<=331,0.00100160898,if(t<=332,0.000993807258,if(t<=333,0.00124114925,if(t<=334,0.00123426412,if(t<=335,0.00141321826,if(t<=336,0.00118332628,if(t<=337,0.00109470055,if(t<=338,0.00125019427,if(t<=339,0.00135455371,if(t<=340,0.0019431852,if(t<=341,0.00205543168,if(t<=342,0.00197207562,if(t<=343,0.0022614449,if(t<=344,0.00211490243,if(t<=345,0.00210695833,if(t<=346,0.00249495193,if(t<=347,0.00234941068,if(t<=348,0.00226462926,if(t<=349,0.00192793935,if(t<=350,0.002307822,if(t<=351,0.00177314607,if(t<=352,0.00204756246,if(t<=353,0.00223537455,if(t<=354,0.00265125171,if(t<=355,0.00215845046,if(t<=356,0.00219770402,if(t<=357,0.00178428238,if(t<=358,0.00184590186,if(t<=359,0.0018605743,if(t<=360,0.00184659497,if(t<=361,0.00229017668,if(t<=362,0.00253196493,if(t<=363,0.00239098899,if(t<=364,0.00211185421,if(t<=365,0.00219407719,if(t<=366,0.00212246707,if(t<=367,0.00269861999,if(t<=368,0.00266277044,if(t<=369,0.0022864101,if(t<=370,0.00238106143,if(t<=371,0.00288706782,if(t<=372,0.00241887213,if(t<=373,0.00264944029,if(t<=374,0.00283053906,if(t<=375,0.00324595184,if(t<=376,0.00288717874,if(t<=377,0.00276439946,if(t<=378,0.00244384282,if(t<=379,0.00233597338,if(t<=380,0.00279352064,if(t<=381,0.00286037951,if(t<=382,0.00328170603,if(t<=383,0.002822949,if(t<=384,0.00278954494,if(t<=385,0.00312619711,if(t<=386,0.00324124337,if(t<=387,0.00365400495,if(t<=388,0.00402022148,if(t<=389,0.00451327855,if(t<=390,0.00463343495,if(t<=391,0.00361972256,if(t<=392,0.00421404306,if(t<=393,0.00450737728,if(t<=394,0.00385689985,if(t<=395,0.00706347035,if(t<=396,0.00548992622,if(t<=397,0.00561269851,if(t<=398,0.00565157042,if(t<=399,0.00465943143,if(t<=400,0.00360607661,if(t<=401,0.00424833829,if(t<=402,0.00506165543,if(t<=403,0.00554584679,if(t<=404,0.00567074572,if(t<=405,0.00521791533,if(t<=406,0.00511027778,if(t<=407,0.00463445002,if(t<=408,0.0048334687,if(t<=409,0.00495195688,if(t<=410,0.00549367799,if(t<=411,0.00563900702,if(t<=412,0.00467717288,if(t<=413,0.00464379518,if(t<=414,0.00459904476,if(t<=415,0.00454237307,if(t<=416,0.00500574242,if(t<=417,0.00531713904,if(t<=418,0.00561133477,if(t<=419,0.00533865191,if(t<=420,0.00495078846,if(t<=421,0.00463678844,if(t<=422,0.00473844747,if(t<=423,0.0054393895,if(t<=424,0.00545525246,if(t<=425,0.00541193326,if(t<=426,0.00509452208,if(t<=427,0.00660187229,if(t<=428,0.00417453135,if(t<=429,0.00467057068,if(t<=430,0.00516133914,if(t<=431,0.00579060434,if(t<=432,0.00527368183,if(t<=433,0.0046510559,if(t<=434,0.00430932033,if(t<=435,0.00469632041,if(t<=436,0.00451319727,if(t<=437,0.00525834823,if(t<=438,0.00514407899,if(t<=439,0.00424489032,if(t<=440,0.00338261955,if(t<=441,0.0038480963,if(t<=442,0.00292950561,if(t<=443,0.00356221514,if(t<=444,0.00426978001,if(t<=445,0.00498272013,if(t<=446,0.00406037155,if(t<=447,0.00385850101,if(t<=448,0.00311324383,if(t<=449,0.00287080426,if(t<=450,0.00249969302,if(t<=451,0.00303688666,if(t<=452,0.00373753143,if(t<=453,0.00334610566,if(t<=454,0.00271933283,if(t<=455,0.00249564984,if(t<=456,0.00211065932,if(t<=457,0.0026296495,if(t<=458,0.002927413,if(t<=459,0.00348787669,if(t<=460,0.00360563614,if(t<=461,0.00305593177,if(t<=462,0.0029747901,if(t<=463,0.00313546965,if(t<=464,0.00427331421,if(t<=465,0.00367859101,if(t<=466,0.0038757078,if(t<=467,0.00345077,if(t<=468,0.00294496232,if(t<=469,0.00280944761,if(t<=470,0.00320988109,if(t<=471,0.00327554366,if(t<=472,0.00291552997,if(t<=473,0.00379463693,if(t<=474,0.00296006542,if(t<=475,0.00296144959,if(t<=476,0.00226444315,if(t<=477,0.00222587449,if(t<=478,0.00208900522,if(t<=479,0.00235789914,if(t<=480,0.0023527227,if(t<=481,0.00225757636,if(t<=482,0.00156006694,if(t<=483,0.00200007592,if(t<=484,0.00177305229,if(t<=485,0.00132721137,if(t<=486,0.0016157386,if(t<=487,0.00160173321,if(t<=488,0.00161771581,if(t<=489,0.00120030271,if(t<=490,0.00106073605,if(t<=491,0.00109226802,if(t<=492,0.0009426437350000001,if(t<=493,0.00129775163,if(t<=494,0.00148914411,if(t<=495,0.00126664783,if(t<=496,0.00111729785,if(t<=497,0.000928262283,if(t<=498,0.00100128739,if(t<=499,0.000862123754,if(t<=500,0.00143578505,if(t<=501,0.00159369446,if(t<=502,0.001236268,if(t<=503,0.0010974177,if(t<=504,0.00116777929,if(t<=505,0.00129901145,if(t<=506,0.00143993669,if(t<=507,0.00137057727,if(t<=508,0.00129378217,if(t<=509,0.00105560763,if(t<=510,0.00076959134,if(t<=511,0.00100224246,if(t<=512,0.00126489835,if(t<=513,0.000839568459,if(t<=514,0.00104061086,if(t<=515,0.0012489978,if(t<=516,0.000909710251,if(t<=517,0.00106807397,if(t<=518,0.00092042926,if(t<=519,0.000568671374,if(t<=520,0.00107534612,if(t<=521,0.000977098888,if(t<=522,0.0011913604,if(t<=523,0.0020660573,if(t<=524,0.000776079056,if(t<=525,0.0009384054229999999,if(t<=526,0.0007691787249999999,if(t<=527,0.0008221690370000001,if(t<=528,0.000977691101,if(t<=529,0.00120703073,if(t<=530,0.00115212883,if(t<=531,0.0009606733930000001,if(t<=532,0.00093316483,if(t<=533,0.0007720669550000001,if(t<=534,0.00120225262,if(t<=535,0.0011870245,if(t<=536,0.00108866938,if(t<=537,0.0009816442539999999,if(t<=538,0.0013641676,if(t<=539,0.000946980045,if(t<=540,0.0009865161470000001,if(t<=541,0.00106015651,if(t<=542,0.0011457813,if(t<=543,0.00126624345,if(t<=544,0.00136449029,if(t<=545,0.00102888928,if(t<=546,0.000864759508,if(t<=547,0.0011350614,if(t<=548,0.00094079968,if(t<=549,0.00106408062,if(t<=550,0.00155375609,if(t<=551,0.000838952779,if(t<=552,0.00106263742,if(t<=553,0.00118428894,if(t<=554,0.000855891218,if(t<=555,0.000815682206,if(t<=556,0.00102089848,if(t<=557,0.00110255282,if(t<=558,0.00113035448,if(t<=559,0.00102012975,if(t<=560,0.00110705653,if(t<=561,0.000705581016,if(t<=562,0.000993763855,if(t<=563,0.00118845612,if(t<=564,0.00117255526,if(t<=565,0.000896920008,if(t<=566,0.00116252977,if(t<=567,0.0009774145669999999,if(t<=568,0.000774332103,if(t<=569,0.00102867561,if(t<=570,0.000824192259,if(t<=571,0.000945787156,if(t<=572,0.000867970103,if(t<=573,0.000975609124,if(t<=574,0.0009400845809999999,if(t<=575,0.000798736412,if(t<=576,0.000715158278,if(t<=577,0.000796893693,if(t<=578,0.000646695582,if(t<=579,0.000983652225,if(t<=580,0.000844168204,if(t<=581,0.000706883968,if(t<=582,0.00075490277,if(t<=583,0.000968707132,if(t<=584,0.000823652744,if(t<=585,0.000913533955,if(t<=586,0.000758321971,if(t<=587,0.000722756758,if(t<=588,0.000708912186,if(t<=589,0.000814718917,if(t<=590,0.000692181581,if(t<=591,0.000874866316,if(t<=592,0.000687077945,if(t<=593,0.00101249691,if(t<=594,0.000789045455,if(t<=595,0.000773614795,if(t<=596,0.000526705332,if(t<=597,0.000706965066,if(t<=598,0.000903633251,if(t<=599,0.000590024411,if(t<=600,0.000936203932,if(t<=601,0.000607883075,if(t<=602,0.000564723531,if(t<=603,0.000724888451,if(t<=604,0.00068726425,if(t<=605,0.000555183276,if(t<=606,0.000856091978,if(t<=607,0.000576251369,if(t<=608,0.0009014603059999999,if(t<=609,0.000536780404,if(t<=610,0.0006876480990000001,if(t<=611,0.000371006631,if(t<=612,0.000692669203,if(t<=613,0.00083516197,if(t<=614,0.00038463401,if(t<=615,0.000800101713,if(t<=616,0.000375803641,if(t<=617,0.0006264554589999999,if(t<=618,0.000526031526,if(t<=619,0.000499368607,if(t<=620,0.000428305584,if(t<=621,0.000909464485,if(t<=622,0.000351236661,if(t<=623,0.000566571376,if(t<=624,0.000429427975,if(t<=625,0.000499533864,if(t<=626,0.000526757148,if(t<=627,0.000225809721,if(t<=628,0.0005403013610000001,if(t<=629,0.000240458659,if(t<=630,0.000516079477,if(t<=631,0.000660882077,if(t<=632,0.000566899036,if(t<=633,0.00115467547,if(t<=634,0.000633427116,if(t<=635,0.000518385602,if(t<=636,0.000749428245,if(t<=637,0.000913122119,if(t<=638,0.000786391348,if(t<=639,0.0012730781,if(t<=640,0.00129256234,if(t<=641,0.00115637457,if(t<=642,0.00102572807,if(t<=643,0.00105539285,if(t<=644,0.00119078863,if(t<=645,0.000732476407,if(t<=646,0.0011368034,if(t<=647,0.00143053847,if(t<=648,0.000947157648,if(t<=649,0.00133587678,0)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
+end functions
+begin reaction rules
+# timer
+0->counter() 1
+0->V() v_rate()
+end reaction rules
+end model
+
+#generate_network({overwrite=>1})
+#simulate({suffix=>"ODE",method=>"ode",t_start=>0,t_end=>1000,n_steps=>1000,print_functions=>1}) # works for cases 1 and 2
+simulate({suffix=>"SSA",method=>"ssa",t_start=>0,t_end=>1000,n_steps=>1000,seed=>1,print_functions=>1}) # works for cases 1 and 2
+
+#simulate({suffix=>"NF",method=>"nf",t_start=>0,t_end=>1000,n_steps=>1000,seed=>1,print_functions=>1}) # works for case 1, fails for case 2
diff --git a/Issues/nestedIF/BillsTest_NF.species b/Issues/nestedIF/BillsTest_NF.species
new file mode 100644
index 00000000..14040562
--- /dev/null
+++ b/Issues/nestedIF/BillsTest_NF.species
@@ -0,0 +1,4 @@
+# nfsim generated species list for system: 'BillsTest'
+# warning! this feature is not yet fully tested!
+V() 2
+counter() 973
diff --git a/Issues/nestedIF/BillsTest_NF.xml b/Issues/nestedIF/BillsTest_NF.xml
new file mode 100644
index 00000000..f0bde959
--- /dev/null
+++ b/Issues/nestedIF/BillsTest_NF.xml
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1e4*if((t<297),1e-6,if((t<=298),1.12314383e-05,if((t<=299),9.94451901e-06,if((t<=300),4.74735912e-05,if((t<=301),2.11759573e-05,if((t<=302),0,if((t<=303),8.68001985e-05,if((t<=304),3.62421529e-05,if((t<=305),8.93918412e-05,if((t<=306),0.000146015146,if((t<=307),0.00010497702,if((t<=308),7.94473222e-05,if((t<=309),6.05025646e-05,if((t<=310),0.000364352105,if((t<=311),0.000201739564,if((t<=312),0.000357759509,if((t<=313),0.000269842203,if((t<=314),0.000257166618,if((t<=315),0.000470011593,if((t<=316),0.000451941228,if((t<=317),0.000253944211,if((t<=318),0.0006239742879999999,if((t<=319),0.00066809744,if((t<=320),0.000499101616,if((t<=321),0.000321104073,if((t<=322),0.000519506807,if((t<=323),0.000424076528,if((t<=324),0.000449397629,if((t<=325),0.000884025501,if((t<=326),0.000654416186,if((t<=327),0.00064374717,if((t<=328),0.000789273122,if((t<=329),0.000803543557,if((t<=330),0.000638530434,if((t<=331),0.00100160898,if((t<=332),0.000993807258,if((t<=333),0.00124114925,if((t<=334),0.00123426412,if((t<=335),0.00141321826,if((t<=336),0.00118332628,if((t<=337),0.00109470055,if((t<=338),0.00125019427,if((t<=339),0.00135455371,if((t<=340),0.0019431852,if((t<=341),0.00205543168,if((t<=342),0.00197207562,if((t<=343),0.0022614449,if((t<=344),0.00211490243,if((t<=345),0.00210695833,if((t<=346),0.00249495193,if((t<=347),0.00234941068,if((t<=348),0.00226462926,if((t<=349),0.00192793935,if((t<=350),0.002307822,if((t<=351),0.00177314607,if((t<=352),0.00204756246,if((t<=353),0.00223537455,if((t<=354),0.00265125171,if((t<=355),0.00215845046,if((t<=356),0.00219770402,if((t<=357),0.00178428238,if((t<=358),0.00184590186,if((t<=359),0.0018605743,if((t<=360),0.00184659497,if((t<=361),0.00229017668,if((t<=362),0.00253196493,if((t<=363),0.00239098899,if((t<=364),0.00211185421,if((t<=365),0.00219407719,if((t<=366),0.00212246707,if((t<=367),0.00269861999,if((t<=368),0.00266277044,if((t<=369),0.0022864101,if((t<=370),0.00238106143,if((t<=371),0.00288706782,if((t<=372),0.00241887213,if((t<=373),0.00264944029,if((t<=374),0.00283053906,if((t<=375),0.00324595184,if((t<=376),0.00288717874,if((t<=377),0.00276439946,if((t<=378),0.00244384282,if((t<=379),0.00233597338,if((t<=380),0.00279352064,if((t<=381),0.00286037951,if((t<=382),0.00328170603,if((t<=383),0.002822949,if((t<=384),0.00278954494,if((t<=385),0.00312619711,if((t<=386),0.00324124337,if((t<=387),0.00365400495,if((t<=388),0.00402022148,if((t<=389),0.00451327855,if((t<=390),0.00463343495,if((t<=391),0.00361972256,if((t<=392),0.00421404306,if((t<=393),0.00450737728,if((t<=394),0.00385689985,if((t<=395),0.00706347035,if((t<=396),0.00548992622,if((t<=397),0.00561269851,if((t<=398),0.00565157042,if((t<=399),0.00465943143,if((t<=400),0.00360607661,if((t<=401),0.00424833829,if((t<=402),0.00506165543,if((t<=403),0.00554584679,if((t<=404),0.00567074572,if((t<=405),0.00521791533,if((t<=406),0.00511027778,if((t<=407),0.00463445002,if((t<=408),0.0048334687,if((t<=409),0.00495195688,if((t<=410),0.00549367799,if((t<=411),0.00563900702,if((t<=412),0.00467717288,if((t<=413),0.00464379518,if((t<=414),0.00459904476,if((t<=415),0.00454237307,if((t<=416),0.00500574242,if((t<=417),0.00531713904,if((t<=418),0.00561133477,if((t<=419),0.00533865191,if((t<=420),0.00495078846,if((t<=421),0.00463678844,if((t<=422),0.00473844747,if((t<=423),0.0054393895,if((t<=424),0.00545525246,if((t<=425),0.00541193326,if((t<=426),0.00509452208,if((t<=427),0.00660187229,if((t<=428),0.00417453135,if((t<=429),0.00467057068,if((t<=430),0.00516133914,if((t<=431),0.00579060434,if((t<=432),0.00527368183,if((t<=433),0.0046510559,if((t<=434),0.00430932033,if((t<=435),0.00469632041,if((t<=436),0.00451319727,if((t<=437),0.00525834823,if((t<=438),0.00514407899,if((t<=439),0.00424489032,if((t<=440),0.00338261955,if((t<=441),0.0038480963,if((t<=442),0.00292950561,if((t<=443),0.00356221514,if((t<=444),0.00426978001,if((t<=445),0.00498272013,if((t<=446),0.00406037155,if((t<=447),0.00385850101,if((t<=448),0.00311324383,if((t<=449),0.00287080426,if((t<=450),0.00249969302,if((t<=451),0.00303688666,if((t<=452),0.00373753143,if((t<=453),0.00334610566,if((t<=454),0.00271933283,if((t<=455),0.00249564984,if((t<=456),0.00211065932,if((t<=457),0.0026296495,if((t<=458),0.002927413,if((t<=459),0.00348787669,if((t<=460),0.00360563614,if((t<=461),0.00305593177,if((t<=462),0.0029747901,if((t<=463),0.00313546965,if((t<=464),0.00427331421,if((t<=465),0.00367859101,if((t<=466),0.0038757078,if((t<=467),0.00345077,if((t<=468),0.00294496232,if((t<=469),0.00280944761,if((t<=470),0.00320988109,if((t<=471),0.00327554366,if((t<=472),0.00291552997,if((t<=473),0.00379463693,if((t<=474),0.00296006542,if((t<=475),0.00296144959,if((t<=476),0.00226444315,if((t<=477),0.00222587449,if((t<=478),0.00208900522,if((t<=479),0.00235789914,if((t<=480),0.0023527227,if((t<=481),0.00225757636,if((t<=482),0.00156006694,if((t<=483),0.00200007592,if((t<=484),0.00177305229,if((t<=485),0.00132721137,if((t<=486),0.0016157386,if((t<=487),0.00160173321,if((t<=488),0.00161771581,if((t<=489),0.00120030271,if((t<=490),0.00106073605,if((t<=491),0.00109226802,if((t<=492),0.0009426437350000001,if((t<=493),0.00129775163,if((t<=494),0.00148914411,if((t<=495),0.00126664783,if((t<=496),0.00111729785,if((t<=497),0.000928262283,if((t<=498),0.00100128739,if((t<=499),0.000862123754,if((t<=500),0.00143578505,if((t<=501),0.00159369446,if((t<=502),0.001236268,if((t<=503),0.0010974177,if((t<=504),0.00116777929,if((t<=505),0.00129901145,if((t<=506),0.00143993669,if((t<=507),0.00137057727,if((t<=508),0.00129378217,if((t<=509),0.00105560763,if((t<=510),0.00076959134,if((t<=511),0.00100224246,if((t<=512),0.00126489835,if((t<=513),0.000839568459,if((t<=514),0.00104061086,if((t<=515),0.0012489978,if((t<=516),0.000909710251,if((t<=517),0.00106807397,if((t<=518),0.00092042926,if((t<=519),0.000568671374,if((t<=520),0.00107534612,if((t<=521),0.000977098888,if((t<=522),0.0011913604,if((t<=523),0.0020660573,if((t<=524),0.000776079056,if((t<=525),0.0009384054229999999,if((t<=526),0.0007691787249999999,if((t<=527),0.0008221690370000001,if((t<=528),0.000977691101,if((t<=529),0.00120703073,if((t<=530),0.00115212883,if((t<=531),0.0009606733930000001,if((t<=532),0.00093316483,if((t<=533),0.0007720669550000001,if((t<=534),0.00120225262,if((t<=535),0.0011870245,if((t<=536),0.00108866938,if((t<=537),0.0009816442539999999,if((t<=538),0.0013641676,if((t<=539),0.000946980045,if((t<=540),0.0009865161470000001,if((t<=541),0.00106015651,if((t<=542),0.0011457813,if((t<=543),0.00126624345,if((t<=544),0.00136449029,if((t<=545),0.00102888928,if((t<=546),0.000864759508,if((t<=547),0.0011350614,if((t<=548),0.00094079968,if((t<=549),0.00106408062,if((t<=550),0.00155375609,if((t<=551),0.000838952779,if((t<=552),0.00106263742,if((t<=553),0.00118428894,if((t<=554),0.000855891218,if((t<=555),0.000815682206,if((t<=556),0.00102089848,if((t<=557),0.00110255282,if((t<=558),0.00113035448,if((t<=559),0.00102012975,if((t<=560),0.00110705653,if((t<=561),0.000705581016,if((t<=562),0.000993763855,if((t<=563),0.00118845612,if((t<=564),0.00117255526,if((t<=565),0.000896920008,if((t<=566),0.00116252977,if((t<=567),0.0009774145669999999,if((t<=568),0.000774332103,if((t<=569),0.00102867561,if((t<=570),0.000824192259,if((t<=571),0.000945787156,if((t<=572),0.000867970103,if((t<=573),0.000975609124,if((t<=574),0.0009400845809999999,if((t<=575),0.000798736412,if((t<=576),0.000715158278,if((t<=577),0.000796893693,if((t<=578),0.000646695582,if((t<=579),0.000983652225,if((t<=580),0.000844168204,if((t<=581),0.000706883968,if((t<=582),0.00075490277,if((t<=583),0.000968707132,if((t<=584),0.000823652744,if((t<=585),0.000913533955,if((t<=586),0.000758321971,if((t<=587),0.000722756758,if((t<=588),0.000708912186,if((t<=589),0.000814718917,if((t<=590),0.000692181581,if((t<=591),0.000874866316,if((t<=592),0.000687077945,if((t<=593),0.00101249691,if((t<=594),0.000789045455,if((t<=595),0.000773614795,if((t<=596),0.000526705332,if((t<=597),0.000706965066,if((t<=598),0.000903633251,if((t<=599),0.000590024411,if((t<=600),0.000936203932,if((t<=601),0.000607883075,if((t<=602),0.000564723531,if((t<=603),0.000724888451,if((t<=604),0.00068726425,if((t<=605),0.000555183276,if((t<=606),0.000856091978,if((t<=607),0.000576251369,if((t<=608),0.0009014603059999999,if((t<=609),0.000536780404,if((t<=610),0.0006876480990000001,if((t<=611),0.000371006631,if((t<=612),0.000692669203,if((t<=613),0.00083516197,if((t<=614),0.00038463401,if((t<=615),0.000800101713,if((t<=616),0.000375803641,if((t<=617),0.0006264554589999999,if((t<=618),0.000526031526,if((t<=619),0.000499368607,if((t<=620),0.000428305584,if((t<=621),0.000909464485,if((t<=622),0.000351236661,if((t<=623),0.000566571376,if((t<=624),0.000429427975,if((t<=625),0.000499533864,if((t<=626),0.000526757148,if((t<=627),0.000225809721,if((t<=628),0.0005403013610000001,if((t<=629),0.000240458659,if((t<=630),0.000516079477,if((t<=631),0.000660882077,if((t<=632),0.000566899036,if((t<=633),0.00115467547,if((t<=634),0.000633427116,if((t<=635),0.000518385602,if((t<=636),0.000749428245,if((t<=637),0.000913122119,if((t<=638),0.000786391348,if((t<=639),0.0012730781,if((t<=640),0.00129256234,if((t<=641),0.00115637457,if((t<=642),0.00102572807,if((t<=643),0.00105539285,if((t<=644),0.00119078863,if((t<=645),0.000732476407,if((t<=646),0.0011368034,if((t<=647),0.00143053847,if((t<=648),0.000947157648,if((t<=649),0.00133587678,0)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
+
+
+
+
diff --git a/Issues/nestedIF/nestedIf.bngl b/Issues/nestedIF/nestedIf.bngl
new file mode 100644
index 00000000..2aa70173
--- /dev/null
+++ b/Issues/nestedIF/nestedIf.bngl
@@ -0,0 +1,18 @@
+begin model
+
+begin species
+ A() 0
+end species
+
+# begin observables
+# Molecules Atot A()
+# end observables
+
+begin reaction rules
+ 0 -> A() 1 # Data_DailyCases()
+end reaction rules
+
+end model
+
+generate_network({overwrite=>1})
+simulate({method=>"ssa",t_end=>150,n_steps=>151})
\ No newline at end of file
diff --git a/Issues/nestedIF/nestedIf/2024_05_03__15_40_02/nestedIf.bngl b/Issues/nestedIF/nestedIf/2024_05_03__15_40_02/nestedIf.bngl
new file mode 100644
index 00000000..43e35744
--- /dev/null
+++ b/Issues/nestedIF/nestedIf/2024_05_03__15_40_02/nestedIf.bngl
@@ -0,0 +1,104 @@
+begin model
+
+begin species
+ A() 0
+end species
+
+begin observables
+ Moleces Atot A()
+end observables
+
+begin functions
+Data_DailyCases()=if(t<=38,0,
+ if(t<=39,1,
+ if(t<=40,0,
+ if(t<=41,1,
+ if(t<=42,9,
+ if(t<=43,11,
+ if(t<=44,22,
+ if(t<=45,45,
+ if(t<=46,17,
+ if(t<=47,36,
+ if(t<=48,31,
+ if(t<=49,44,
+ if(t<=50,109,
+ if(t<=51,95,
+ if(t<=52,189,
+ if(t<=53,122,
+ if(t<=54,218,
+ if(t<=55,425,
+ if(t<=56,1012,
+ if(t<=57,1774,
+ if(t<=58,2952,
+ if(t<=59,3258,
+ if(t<=60,4817,
+ if(t<=61,5711,
+ if(t<=62,4805,
+ if(t<=63,7413,
+ if(t<=64,5941,
+ if(t<=65,5688,
+ if(t<=66,8771,
+ if(t<=67,6266,
+ if(t<=68,7721,
+ if(t<=69,8707,
+ if(t<=70,8153,
+ if(t<=71,8996,
+ if(t<=72,10329,
+ if(t<=73,12274,
+ if(t<=74,8122,
+ if(t<=75,9304,
+ if(t<=76,8314,
+ if(t<=77,9568,
+ if(t<=78,10765,
+ if(t<=79,10794,
+ if(t<=80,10160,
+ if(t<=81,8435,
+ if(t<=82,6548,
+ if(t<=83,7402,
+ if(t<=84,11755,
+ if(t<=85,8631,
+ if(t<=86,7532,
+ if(t<=87,7249,
+ if(t<=88,6199,
+ if(t<=89,4867,
+ if(t<=90,4324,
+ if(t<=91,5659,
+ if(t<=92,6341,
+ if(t<=93,8286,
+ if(t<=94,10683,
+ if(t<=95,6013,
+ if(t<=96,4077,
+ if(t<=97,3285,
+ if(t<=98,4718,
+ if(t<=99,4702,
+ if(t<=100,3879,
+ if(t<=101,4559,
+ if(t<=102,3699,
+ if(t<=103,2524,
+ if(t<=104,2302,
+ if(t<=105,2746,
+ if(t<=106,3526,
+ if(t<=107,2873,
+ if(t<=108,2715,
+ if(t<=109,2138,
+ if(t<=110,1610,
+ if(t<=111,1438,
+ if(t<=112,2123,
+ if(t<=113,2364,
+ if(t<=114,2759,
+ if(t<=115,2185,
+ if(t<=116,1901,
+ if(t<=117,1241,
+ if(t<=118,1479,
+ if(t<=119,1478,
+ if(t<=120,2078,
+ 0)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
+end functions
+
+begin reaction rules
+ 0 -> A() Data_DailyCases()
+end reaction rules
+
+end model
+
+simulate({method=>"ssa",t_end=>150,n_steps=>151})
\ No newline at end of file
diff --git a/Issues/nestedIF/nestedIf/2024_05_03__15_40_30/nestedIf.bngl b/Issues/nestedIF/nestedIf/2024_05_03__15_40_30/nestedIf.bngl
new file mode 100644
index 00000000..87d595e4
--- /dev/null
+++ b/Issues/nestedIF/nestedIf/2024_05_03__15_40_30/nestedIf.bngl
@@ -0,0 +1,104 @@
+begin model
+
+begin species
+ A() 0
+end species
+
+begin observables
+ Molecules Atot A()
+end observables
+
+begin functions
+Data_DailyCases()=if(t<=38,0,
+ if(t<=39,1,
+ if(t<=40,0,
+ if(t<=41,1,
+ if(t<=42,9,
+ if(t<=43,11,
+ if(t<=44,22,
+ if(t<=45,45,
+ if(t<=46,17,
+ if(t<=47,36,
+ if(t<=48,31,
+ if(t<=49,44,
+ if(t<=50,109,
+ if(t<=51,95,
+ if(t<=52,189,
+ if(t<=53,122,
+ if(t<=54,218,
+ if(t<=55,425,
+ if(t<=56,1012,
+ if(t<=57,1774,
+ if(t<=58,2952,
+ if(t<=59,3258,
+ if(t<=60,4817,
+ if(t<=61,5711,
+ if(t<=62,4805,
+ if(t<=63,7413,
+ if(t<=64,5941,
+ if(t<=65,5688,
+ if(t<=66,8771,
+ if(t<=67,6266,
+ if(t<=68,7721,
+ if(t<=69,8707,
+ if(t<=70,8153,
+ if(t<=71,8996,
+ if(t<=72,10329,
+ if(t<=73,12274,
+ if(t<=74,8122,
+ if(t<=75,9304,
+ if(t<=76,8314,
+ if(t<=77,9568,
+ if(t<=78,10765,
+ if(t<=79,10794,
+ if(t<=80,10160,
+ if(t<=81,8435,
+ if(t<=82,6548,
+ if(t<=83,7402,
+ if(t<=84,11755,
+ if(t<=85,8631,
+ if(t<=86,7532,
+ if(t<=87,7249,
+ if(t<=88,6199,
+ if(t<=89,4867,
+ if(t<=90,4324,
+ if(t<=91,5659,
+ if(t<=92,6341,
+ if(t<=93,8286,
+ if(t<=94,10683,
+ if(t<=95,6013,
+ if(t<=96,4077,
+ if(t<=97,3285,
+ if(t<=98,4718,
+ if(t<=99,4702,
+ if(t<=100,3879,
+ if(t<=101,4559,
+ if(t<=102,3699,
+ if(t<=103,2524,
+ if(t<=104,2302,
+ if(t<=105,2746,
+ if(t<=106,3526,
+ if(t<=107,2873,
+ if(t<=108,2715,
+ if(t<=109,2138,
+ if(t<=110,1610,
+ if(t<=111,1438,
+ if(t<=112,2123,
+ if(t<=113,2364,
+ if(t<=114,2759,
+ if(t<=115,2185,
+ if(t<=116,1901,
+ if(t<=117,1241,
+ if(t<=118,1479,
+ if(t<=119,1478,
+ if(t<=120,2078,
+ 0)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
+end functions
+
+begin reaction rules
+ 0 -> A() Data_DailyCases()
+end reaction rules
+
+end model
+
+simulate({method=>"ssa",t_end=>150,n_steps=>151})
\ No newline at end of file
diff --git a/Issues/nestedIF/nestedIf/2024_05_03__15_41_01/nestedIf.bngl b/Issues/nestedIF/nestedIf/2024_05_03__15_41_01/nestedIf.bngl
new file mode 100644
index 00000000..2aa70173
--- /dev/null
+++ b/Issues/nestedIF/nestedIf/2024_05_03__15_41_01/nestedIf.bngl
@@ -0,0 +1,18 @@
+begin model
+
+begin species
+ A() 0
+end species
+
+# begin observables
+# Molecules Atot A()
+# end observables
+
+begin reaction rules
+ 0 -> A() 1 # Data_DailyCases()
+end reaction rules
+
+end model
+
+generate_network({overwrite=>1})
+simulate({method=>"ssa",t_end=>150,n_steps=>151})
\ No newline at end of file
diff --git a/Issues/nestedIF/nested_if.bngl b/Issues/nestedIF/nested_if.bngl
new file mode 100644
index 00000000..afc14469
--- /dev/null
+++ b/Issues/nestedIF/nested_if.bngl
@@ -0,0 +1,43 @@
+begin model
+# example of NFsim error caused by too deep nesting of if-then-else
+# statements in function definition
+
+ begin parameters
+ end parameters
+
+ begin molecule types
+ V()
+ counter()
+ end molecule types
+
+ begin seed species
+ V() 0
+ counter() 0
+ end seed species
+
+ begin observables
+ Molecules t counter()
+ Molecules V V()
+ end observables
+
+ begin functions
+ # CASE 1: constant rate
+ #v_rate()=1e-6
+
+ # CASE 2: variable rate defined in terms of nested if-then-else statements
+ v_rate()=if(t<=297,1e-6,if(t<=298,1.12314383e-05,if(t<=299,9.94451901e-06,if(t<=300,4.74735912e-05,if(t<=301,2.11759573e-05,if(t<=302,0,if(t<=303,8.68001985e-05,if(t<=304,3.62421529e-05,if(t<=305,8.93918412e-05,if(t<=306,0.000146015146,if(t<=307,0.00010497702,if(t<=308,7.94473222e-05,if(t<=309,6.05025646e-05,if(t<=310,0.000364352105,if(t<=311,0.000201739564,if(t<=312,0.000357759509,if(t<=313,0.000269842203,if(t<=314,0.000257166618,if(t<=315,0.000470011593,if(t<=316,0.000451941228,if(t<=317,0.000253944211,if(t<=318,0.0006239742879999999,if(t<=319,0.00066809744,if(t<=320,0.000499101616,if(t<=321,0.000321104073,if(t<=322,0.000519506807,if(t<=323,0.000424076528,if(t<=324,0.000449397629,if(t<=325,0.000884025501,if(t<=326,0.000654416186,if(t<=327,0.00064374717,if(t<=328,0.000789273122,if(t<=329,0.000803543557,if(t<=330,0.000638530434,if(t<=331,0.00100160898,if(t<=332,0.000993807258,if(t<=333,0.00124114925,if(t<=334,0.00123426412,if(t<=335,0.00141321826,if(t<=336,0.00118332628,if(t<=337,0.00109470055,if(t<=338,0.00125019427,if(t<=339,0.00135455371,if(t<=340,0.0019431852,if(t<=341,0.00205543168,if(t<=342,0.00197207562,if(t<=343,0.0022614449,if(t<=344,0.00211490243,if(t<=345,0.00210695833,if(t<=346,0.00249495193,if(t<=347,0.00234941068,if(t<=348,0.00226462926,if(t<=349,0.00192793935,if(t<=350,0.002307822,if(t<=351,0.00177314607,if(t<=352,0.00204756246,if(t<=353,0.00223537455,if(t<=354,0.00265125171,if(t<=355,0.00215845046,if(t<=356,0.00219770402,if(t<=357,0.00178428238,if(t<=358,0.00184590186,if(t<=359,0.0018605743,if(t<=360,0.00184659497,if(t<=361,0.00229017668,if(t<=362,0.00253196493,if(t<=363,0.00239098899,if(t<=364,0.00211185421,if(t<=365,0.00219407719,if(t<=366,0.00212246707,if(t<=367,0.00269861999,if(t<=368,0.00266277044,if(t<=369,0.0022864101,if(t<=370,0.00238106143,if(t<=371,0.00288706782,if(t<=372,0.00241887213,if(t<=373,0.00264944029,if(t<=374,0.00283053906,if(t<=375,0.00324595184,if(t<=376,0.00288717874,if(t<=377,0.00276439946,if(t<=378,0.00244384282,if(t<=379,0.00233597338,if(t<=380,0.00279352064,if(t<=381,0.00286037951,if(t<=382,0.00328170603,if(t<=383,0.002822949,if(t<=384,0.00278954494,if(t<=385,0.00312619711,if(t<=386,0.00324124337,if(t<=387,0.00365400495,if(t<=388,0.00402022148,if(t<=389,0.00451327855,if(t<=390,0.00463343495,if(t<=391,0.00361972256,if(t<=392,0.00421404306,if(t<=393,0.00450737728,if(t<=394,0.00385689985,if(t<=395,0.00706347035,if(t<=396,0.00548992622,if(t<=397,0.00561269851,if(t<=398,0.00565157042,if(t<=399,0.00465943143,if(t<=400,0.00360607661,if(t<=401,0.00424833829,if(t<=402,0.00506165543,if(t<=403,0.00554584679,if(t<=404,0.00567074572,if(t<=405,0.00521791533,if(t<=406,0.00511027778,if(t<=407,0.00463445002,if(t<=408,0.0048334687,if(t<=409,0.00495195688,if(t<=410,0.00549367799,if(t<=411,0.00563900702,if(t<=412,0.00467717288,if(t<=413,0.00464379518,if(t<=414,0.00459904476,if(t<=415,0.00454237307,if(t<=416,0.00500574242,if(t<=417,0.00531713904,if(t<=418,0.00561133477,if(t<=419,0.00533865191,if(t<=420,0.00495078846,if(t<=421,0.00463678844,if(t<=422,0.00473844747,if(t<=423,0.0054393895,if(t<=424,0.00545525246,if(t<=425,0.00541193326,if(t<=426,0.00509452208,if(t<=427,0.00660187229,if(t<=428,0.00417453135,if(t<=429,0.00467057068,if(t<=430,0.00516133914,if(t<=431,0.00579060434,if(t<=432,0.00527368183,if(t<=433,0.0046510559,if(t<=434,0.00430932033,if(t<=435,0.00469632041,if(t<=436,0.00451319727,if(t<=437,0.00525834823,if(t<=438,0.00514407899,if(t<=439,0.00424489032,if(t<=440,0.00338261955,if(t<=441,0.0038480963,if(t<=442,0.00292950561,if(t<=443,0.00356221514,if(t<=444,0.00426978001,if(t<=445,0.00498272013,if(t<=446,0.00406037155,if(t<=447,0.00385850101,if(t<=448,0.00311324383,if(t<=449,0.00287080426,if(t<=450,0.00249969302,if(t<=451,0.00303688666,if(t<=452,0.00373753143,if(t<=453,0.00334610566,if(t<=454,0.00271933283,if(t<=455,0.00249564984,if(t<=456,0.00211065932,if(t<=457,0.0026296495,if(t<=458,0.002927413,if(t<=459,0.00348787669,if(t<=460,0.00360563614,if(t<=461,0.00305593177,if(t<=462,0.0029747901,if(t<=463,0.00313546965,if(t<=464,0.00427331421,if(t<=465,0.00367859101,if(t<=466,0.0038757078,if(t<=467,0.00345077,if(t<=468,0.00294496232,if(t<=469,0.00280944761,if(t<=470,0.00320988109,if(t<=471,0.00327554366,if(t<=472,0.00291552997,if(t<=473,0.00379463693,if(t<=474,0.00296006542,if(t<=475,0.00296144959,if(t<=476,0.00226444315,if(t<=477,0.00222587449,if(t<=478,0.00208900522,if(t<=479,0.00235789914,if(t<=480,0.0023527227,if(t<=481,0.00225757636,if(t<=482,0.00156006694,if(t<=483,0.00200007592,if(t<=484,0.00177305229,if(t<=485,0.00132721137,if(t<=486,0.0016157386,if(t<=487,0.00160173321,if(t<=488,0.00161771581,if(t<=489,0.00120030271,if(t<=490,0.00106073605,if(t<=491,0.00109226802,if(t<=492,0.0009426437350000001,if(t<=493,0.00129775163,if(t<=494,0.00148914411,if(t<=495,0.00126664783,if(t<=496,0.00111729785,if(t<=497,0.000928262283,if(t<=498,0.00100128739,if(t<=499,0.000862123754,if(t<=500,0.00143578505,if(t<=501,0.00159369446,if(t<=502,0.001236268,if(t<=503,0.0010974177,if(t<=504,0.00116777929,if(t<=505,0.00129901145,if(t<=506,0.00143993669,if(t<=507,0.00137057727,if(t<=508,0.00129378217,if(t<=509,0.00105560763,if(t<=510,0.00076959134,if(t<=511,0.00100224246,if(t<=512,0.00126489835,if(t<=513,0.000839568459,if(t<=514,0.00104061086,if(t<=515,0.0012489978,if(t<=516,0.000909710251,if(t<=517,0.00106807397,if(t<=518,0.00092042926,if(t<=519,0.000568671374,if(t<=520,0.00107534612,if(t<=521,0.000977098888,if(t<=522,0.0011913604,if(t<=523,0.0020660573,if(t<=524,0.000776079056,if(t<=525,0.0009384054229999999,if(t<=526,0.0007691787249999999,if(t<=527,0.0008221690370000001,if(t<=528,0.000977691101,if(t<=529,0.00120703073,if(t<=530,0.00115212883,if(t<=531,0.0009606733930000001,if(t<=532,0.00093316483,if(t<=533,0.0007720669550000001,if(t<=534,0.00120225262,if(t<=535,0.0011870245,if(t<=536,0.00108866938,if(t<=537,0.0009816442539999999,if(t<=538,0.0013641676,if(t<=539,0.000946980045,if(t<=540,0.0009865161470000001,if(t<=541,0.00106015651,if(t<=542,0.0011457813,if(t<=543,0.00126624345,if(t<=544,0.00136449029,if(t<=545,0.00102888928,if(t<=546,0.000864759508,if(t<=547,0.0011350614,if(t<=548,0.00094079968,if(t<=549,0.00106408062,if(t<=550,0.00155375609,if(t<=551,0.000838952779,if(t<=552,0.00106263742,if(t<=553,0.00118428894,if(t<=554,0.000855891218,if(t<=555,0.000815682206,if(t<=556,0.00102089848,if(t<=557,0.00110255282,if(t<=558,0.00113035448,if(t<=559,0.00102012975,if(t<=560,0.00110705653,if(t<=561,0.000705581016,if(t<=562,0.000993763855,if(t<=563,0.00118845612,if(t<=564,0.00117255526,if(t<=565,0.000896920008,if(t<=566,0.00116252977,if(t<=567,0.0009774145669999999,if(t<=568,0.000774332103,if(t<=569,0.00102867561,if(t<=570,0.000824192259,if(t<=571,0.000945787156,if(t<=572,0.000867970103,if(t<=573,0.000975609124,if(t<=574,0.0009400845809999999,if(t<=575,0.000798736412,if(t<=576,0.000715158278,if(t<=577,0.000796893693,if(t<=578,0.000646695582,if(t<=579,0.000983652225,if(t<=580,0.000844168204,if(t<=581,0.000706883968,if(t<=582,0.00075490277,if(t<=583,0.000968707132,if(t<=584,0.000823652744,if(t<=585,0.000913533955,if(t<=586,0.000758321971,if(t<=587,0.000722756758,if(t<=588,0.000708912186,if(t<=589,0.000814718917,if(t<=590,0.000692181581,if(t<=591,0.000874866316,if(t<=592,0.000687077945,if(t<=593,0.00101249691,if(t<=594,0.000789045455,if(t<=595,0.000773614795,if(t<=596,0.000526705332,if(t<=597,0.000706965066,if(t<=598,0.000903633251,if(t<=599,0.000590024411,if(t<=600,0.000936203932,if(t<=601,0.000607883075,if(t<=602,0.000564723531,if(t<=603,0.000724888451,if(t<=604,0.00068726425,if(t<=605,0.000555183276,if(t<=606,0.000856091978,if(t<=607,0.000576251369,if(t<=608,0.0009014603059999999,if(t<=609,0.000536780404,if(t<=610,0.0006876480990000001,if(t<=611,0.000371006631,if(t<=612,0.000692669203,if(t<=613,0.00083516197,if(t<=614,0.00038463401,if(t<=615,0.000800101713,if(t<=616,0.000375803641,if(t<=617,0.0006264554589999999,if(t<=618,0.000526031526,if(t<=619,0.000499368607,if(t<=620,0.000428305584,if(t<=621,0.000909464485,if(t<=622,0.000351236661,if(t<=623,0.000566571376,if(t<=624,0.000429427975,if(t<=625,0.000499533864,if(t<=626,0.000526757148,if(t<=627,0.000225809721,if(t<=628,0.0005403013610000001,if(t<=629,0.000240458659,if(t<=630,0.000516079477,if(t<=631,0.000660882077,if(t<=632,0.000566899036,if(t<=633,0.00115467547,if(t<=634,0.000633427116,if(t<=635,0.000518385602,if(t<=636,0.000749428245,if(t<=637,0.000913122119,if(t<=638,0.000786391348,if(t<=639,0.0012730781,if(t<=640,0.00129256234,if(t<=641,0.00115637457,if(t<=642,0.00102572807,if(t<=643,0.00105539285,if(t<=644,0.00119078863,if(t<=645,0.000732476407,if(t<=646,0.0011368034,if(t<=647,0.00143053847,if(t<=648,0.000947157648,if(t<=649,0.00133587678,0)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
+ end functions
+
+ begin reaction rules
+ # timer
+ 0->counter() 1
+ 0->V() 1e4*v_rate()
+ end reaction rules
+
+end model
+
+#generate_network({overwrite=>1})
+
+#simulate({suffix=>"ODE",method=>"ode",t_start=>0,t_end=>1000,n_steps=>1000,print_functions=>1}) # works for cases 1 and 2
+
+simulate({suffix=>"NF",method=>"nf",t_start=>0,t_end=>1000,n_steps=>1000,print_functions=>1}) # works for case 1, fails for case 2
\ No newline at end of file
diff --git a/Issues/nestedIF/test.bngl b/Issues/nestedIF/test.bngl
new file mode 100644
index 00000000..0128ebc5
--- /dev/null
+++ b/Issues/nestedIF/test.bngl
@@ -0,0 +1,101 @@
+begin model
+
+begin species
+ A() 0
+end species
+
+begin observables
+ Molecules Atot A()
+ Molecules tick tick()
+end observables
+begin functions
+ t() tick/1000
+ NI() 10
+ # NI() if(t<=38,0,if(t<=39,1,if(t<=40,0,if(t<=41,1,if(t<=42,9,if(t<=43,11,if(t<=44,22,if(t<=45,45,if(t<=46,17,0)))))))))
+# if(t<=47,36,
+# if(t<=48,31,
+# if(t<=49,44,
+# if(t<=50,109,
+# if(t<=51,95,
+# if(t<=52,189,
+# if(t<=53,122,
+# if(t<=54,218,
+# if(t<=55,425,
+# if(t<=56,1012,
+# if(t<=57,1774,
+# if(t<=58,2952,
+# if(t<=59,3258,
+# if(t<=60,4817,
+# if(t<=61,5711,
+# if(t<=62,4805,
+# if(t<=63,7413,
+# if(t<=64,5941,
+# if(t<=65,5688,
+# if(t<=66,8771,
+# if(t<=67,6266,
+# if(t<=68,7721,
+# if(t<=69,8707,
+# if(t<=70,8153,
+# if(t<=71,8996,
+# if(t<=72,10329,
+# if(t<=73,12274,
+# if(t<=74,8122,
+# if(t<=75,9304,
+# if(t<=76,8314,
+# if(t<=77,9568,
+# if(t<=78,10765,
+# if(t<=79,10794,
+# if(t<=80,10160,
+# if(t<=81,8435,
+# if(t<=82,6548,
+# if(t<=83,7402,
+# if(t<=84,11755,
+# if(t<=85,8631,
+# if(t<=86,7532,
+# if(t<=87,7249,
+# if(t<=88,6199,
+# if(t<=89,4867,
+# if(t<=90,4324,
+# if(t<=91,5659,
+# if(t<=92,6341,
+# if(t<=93,8286,
+# if(t<=94,10683,
+# if(t<=95,6013,
+# if(t<=96,4077,
+# if(t<=97,3285,
+# if(t<=98,4718,
+# if(t<=99,4702,
+# if(t<=100,3879,
+# if(t<=101,4559,
+# if(t<=102,3699,
+# if(t<=103,2524,
+# if(t<=104,2302,
+# if(t<=105,2746,
+# if(t<=106,3526,
+# if(t<=107,2873,
+# if(t<=108,2715,
+# if(t<=109,2138,
+# if(t<=110,1610,
+# if(t<=111,1438,
+# if(t<=112,2123,
+# if(t<=113,2364,
+# if(t<=114,2759,
+# if(t<=115,2185,
+# if(t<=116,1901,
+# if(t<=117,1241,
+# if(t<=118,1479,
+# if(t<=119,1478,
+# if(t<=120,2078,
+#0)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
+end functions
+
+
+begin reaction rules
+ 0->tick() 1000
+ 0 -> A() NI()
+end reaction rules
+
+end model
+
+generate_network({overwrite=>1})
+simulate({method=>"nf",t_end=>150,n_steps=>151})
\ No newline at end of file
diff --git a/Issues/nestedIF/test.species b/Issues/nestedIF/test.species
new file mode 100644
index 00000000..bd00e08b
--- /dev/null
+++ b/Issues/nestedIF/test.species
@@ -0,0 +1,4 @@
+# nfsim generated species list for system: 'test'
+# warning! this feature is not yet fully tested!
+A() 1508
+tick() 149869
diff --git a/Issues/nestedIF/test.xml b/Issues/nestedIF/test.xml
new file mode 100644
index 00000000..1d61e1bb
--- /dev/null
+++ b/Issues/nestedIF/test.xml
@@ -0,0 +1,103 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ tick/1000
+
+
+
+
+ 10
+
+
+
+
diff --git a/Issues/nestedIF/writeIf.ipynb b/Issues/nestedIF/writeIf.ipynb
new file mode 100644
index 00000000..95206733
--- /dev/null
+++ b/Issues/nestedIF/writeIf.ipynb
@@ -0,0 +1,45 @@
+{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import numpy as np"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "expr=\"\"\n",
+ "for i in range(10):\n",
+ " expr= "
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "base",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.9.7"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/bng2/Perl2/Expression.pm b/bng2/Perl2/Expression.pm
index c51d8beb..f6884c0b 100644
--- a/bng2/Perl2/Expression.pm
+++ b/bng2/Perl2/Expression.pm
@@ -15,6 +15,7 @@ package Expression;
use strict;
use warnings;
no warnings 'redefine';
+no warnings 'recursion';
# Perl Modules
use Class::Struct;