Index: branches/2929_PrioritizedGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.PGE/3.3/go-code/go-pge/plug/pge.go
===================================================================
--- branches/2929_PrioritizedGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.PGE/3.3/go-code/go-pge/plug/pge.go	(revision 16614)
+++ branches/2929_PrioritizedGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.PGE/3.3/go-code/go-pge/plug/pge.go	(revision 16615)
@@ -7,5 +7,5 @@
 	"fmt"
 	rt "runtime"
-	rand "math/rand"
+	//rand "math/rand"
 	"strings"
 	probs "github.com/verdverm/go-pge/problems"
@@ -51,4 +51,5 @@
 	trainDatasN = 0
 	nLastResults = 0
+
 	cps.CreateDS(maxGen, pgeRptEpoch, pgeRptCount, pgeArchiveCap, peelCnt, evalrCount, zeroEpsilon, goInitMethod, goGrowMethod, sortType)
 	
@@ -60,5 +61,5 @@
 
 //export InitTreeParams
-func InitTreeParams(Roots *C.char, Nodes *C.char, NonTrig *C.char, Leafs *C.char, UsableVars unsafe.Pointer, nUseableVars int, MaxSize int, MinSize int, MaxDepth int, MinDepth int) {
+func InitTreeParams(Roots *C.char, Nodes *C.char, NonTrig *C.char, Leafs *C.char, nUseableVars int, MaxSize int, MinSize int, MaxDepth int, MinDepth int) {
 	tp = new(probs.TreeParams)
 	goRoots := C.GoString(Roots)
@@ -66,5 +67,5 @@
 	goNonTrig := C.GoString(NonTrig)
 	goLeafs := C.GoString(Leafs)
-	goUsableVars := CIntArrayToSlice(UsableVars, nUseableVars)
+	goUsableVars := CreateUsableVars(nUseableVars)
 	tp.CreateTreeParams(goRoots, goNodes, goNonTrig, goLeafs, goUsableVars, MaxSize, MinSize, MaxDepth, MinDepth)
 }
@@ -72,5 +73,5 @@
 //export AddTrainData
 func AddTrainData(indepNames *C.char, depndNames *C.char, matrix unsafe.Pointer, nEntries int) {
-	trainDatas = make([]*probs.PointSet, 1) //wieso bin i do und ned im initsearch oda so !!
+	trainDatas = make([]*probs.PointSet, 1)
 	trainData = new(probs.PointSet)
 	
@@ -96,4 +97,5 @@
 	
 	testData.InitTrainData(goIndepNames, goDepndNames, matrix, nEntries)
+	
 	testDatas[testDatasN] = testData
 	testDatasN++
@@ -103,8 +105,5 @@
 func InitProblem(Name *C.char, MaxIter int, HitRatio float64, SearchVar int, ProblemTypeString *C.char, numProcs int) {	
 	ep = new(probs.ExprProblem)	
-	
-	//SysNames   []string
-	//VarNames []string
-	
+		
 	ep.IndepNames = probIndepNames
 	ep.DepndNames = probDepndNames
@@ -124,6 +123,7 @@
 	
 	initDone := make(chan int)
+	
 	rt.GOMAXPROCS(numProcs)
-	rand.Seed(rand.Int63())
+	//rand.Seed(rand.Int63())
 	
 	epcomm = new(probs.ExprProblemComm)
@@ -131,4 +131,5 @@
 	epcomm.Cmds = make(chan int)
     epcomm.Rpts = make(chan *probs.ExprReportArray, 64)
+	epcomm.Res = make(chan *probs.ExprReportArray, 64) //Stops at 64 if nothing gets retrieved
 	epcomm.Gen = make(chan [2]int, 64)
 	
@@ -183,9 +184,5 @@
 
 //export GetStepResult
-func GetStepResult(nobestpush *int, bestnewminerr *int, bestlen1 *int, bestlen2 *int, testscore *int, ncoeff *int) *C.char { // coeff unsafe.Pointer
-	*nobestpush = 0
-	*bestnewminerr = 0
-	*bestlen1 = 0
-	*bestlen2 = 0
+func GetStepResult(testscore *int, ncoeff *int) *C.char {
 	*testscore = 0
 	
@@ -194,20 +191,10 @@
 		resultNr++
 		lastStepRes = elem
-		*bestlen1 = len(stepResult)
 		if(elem != nil) {
-			//if elem.Nobestpush {
-			//	*nobestpush = 1;
-			//} else {
-			//	if elem.BestNewMinErr {
-					*bestnewminerr = int(elem.TestError())
-			//	}
-				*testscore = elem.TestScore()
-				*ncoeff = len(elem.Coeff())
-				nCurrentCoeff = 0
-				nMaxCoeff = len(elem.Coeff())
-				//*bestlen1 = 0 //elem.Bestlen1
-				*bestlen2 = 0 //elem.Bestlen2
-				return C.CString(elem.Expr().String())
-			//}
+			*testscore = elem.TestScore()
+			*ncoeff = len(elem.Coeff())
+			nCurrentCoeff = 0
+			nMaxCoeff = len(elem.Coeff())	
+			return C.CString(elem.Expr().String())
 		}
 	}
@@ -218,8 +205,5 @@
 func GetCoeffResult() float64 {
 	var res float64 = 0
-	if nCurrentCoeff < nMaxCoeff {
-		//item := (*float64) (unsafe.Pointer( uintptr(unsafe.Pointer(coeff)) + unsafe.Sizeof(float64(0)) * uintptr(i) ))
-		//*item = elem.Coeff[i]
-		
+	if nCurrentCoeff < nMaxCoeff {		
 		coeffs := lastStepRes.Coeff()
 		res = coeffs[nCurrentCoeff]
@@ -235,8 +219,5 @@
 	nRes := cps.Step()
 	
-	resu, ok := <-epcomm.Rpts
-	
-	//_ = ok
-	
+	resu, ok := <- epcomm.Res
 	resultNr = nLastResults
 	
@@ -244,9 +225,14 @@
 	if ok && resu != nil {
 		stepResult = *resu
-		nNew = nRes // - nLastResults
-		nLastResults = 0 //nRes
+		nNew = nRes
+		nLastResults = 0
 	}
 		
 	return nNew
+}
+
+//export Clear
+func Clear() {
+	cps.Stop()
 }
 
@@ -257,4 +243,13 @@
 	}
 	return false	
+}
+
+func CreateUsableVars(nEntries int) []int {
+	res := make([]int, nEntries)
+	for i := 0; i < nEntries; i++ {
+		res[i] = i
+		fmt.Printf("USEVARnew: %v\n", i)		
+	}
+	return res
 }
 
Index: branches/2929_PrioritizedGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.PGE/3.3/go-code/go-pge/plug/pge_init_method_1.go
===================================================================
--- branches/2929_PrioritizedGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.PGE/3.3/go-code/go-pge/plug/pge_init_method_1.go	(revision 16614)
+++ branches/2929_PrioritizedGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.PGE/3.3/go-code/go-pge/plug/pge_init_method_1.go	(revision 16615)
@@ -12,5 +12,4 @@
 
 	GP := PS.cnfg.treecfg
-	fmt.Printf("%v\n", GP)
 
 	eList := make([]expr.Expr, 0)
@@ -32,15 +31,21 @@
 	// exprs.SetSort(PS.cnfg.sortType)
 	exprs.SetSort(probs.PESORT_PARETO_TST_ERR)
-
+	
 	for i, e := range eList {
 		fmt.Printf("%d:  %v\n", i, e)
+		
 		serial := make([]int, 0, 64)
 		serial = e.Serial(serial)
 		PS.Trie.InsertSerial(serial)
 		// on train data
-		re := RegressExpr(e, PS.prob)
+
+		//fmt.Printf("RegressExpr:  e: %v  || PS.prob: %v\n", e, PS.prob)
+		re := RegressExpr(e, PS.prob)  //DER DO
+		//fmt.Printf("RegressExpr:  e: %v  || PS.prob: %v || %v \n", e, PS.prob, re)
+		
 		re.SetUnitID(i)
 		exprs.Push(re)
 	}
+
 	exprs.Sort()
 	return exprs
Index: branches/2929_PrioritizedGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.PGE/3.3/go-code/go-pge/plug/pge_search.go
===================================================================
--- branches/2929_PrioritizedGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.PGE/3.3/go-code/go-pge/plug/pge_search.go	(revision 16614)
+++ branches/2929_PrioritizedGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.PGE/3.3/go-code/go-pge/plug/pge_search.go	(revision 16615)
@@ -184,5 +184,5 @@
 func (PS *PgeSearch) Init(done chan int, prob *probs.ExprProblem, logdir string, input interface{}) {
 
-	//fmt.Printf("Init'n PGE\n")
+	fmt.Printf("Init'n PGE\n")
 	// setup data
 
@@ -201,8 +201,8 @@
 	PS.cnfg.simprules = srules
 
-	//fmt.Println("Roots:   ", PS.cnfg.treecfg.RootsS)
-	//fmt.Println("Nodes:   ", PS.cnfg.treecfg.NodesS)
-	//fmt.Println("Leafs:   ", PS.cnfg.treecfg.LeafsS)
-	//fmt.Println("NonTrig: ", PS.cnfg.treecfg.NonTrigS)
+	fmt.Println("Roots:   ", PS.cnfg.treecfg.RootsS)
+	fmt.Println("Nodes:   ", PS.cnfg.treecfg.NodesS)
+	fmt.Println("Leafs:   ", PS.cnfg.treecfg.LeafsS)
+	fmt.Println("NonTrig: ", PS.cnfg.treecfg.NonTrigS)
 
 	PS.GenRoots = make([]expr.Expr, len(PS.cnfg.treecfg.Roots))
@@ -228,5 +228,5 @@
 
 		case expr.VAR:
-			//fmt.Println("Use Vars: ", PS.cnfg.treecfg.UsableVars)
+			fmt.Println("Use Vars: ", PS.cnfg.treecfg.UsableVars)
 			for _, i := range PS.cnfg.treecfg.UsableVars {
 				PS.GenLeafs = append(PS.GenLeafs, expr.NewVar(i))
@@ -284,4 +284,8 @@
 }
 
+func (PS *PgeSearch) Stop() {
+	PS.stop = true
+}
+
 func (PS *PgeSearch) Evaluate() {
 
@@ -291,7 +295,7 @@
 			continue
 		}
-		re := RegressExpr(e, PS.prob)
-		////fmt.Printf("reg: %v\n", re)
-		PS.eval_out <- re
+		//re := 
+		//fmt.Printf("reg: %v\n", re)
+		PS.eval_out <- RegressExpr(e, PS.prob)
 	}
 
@@ -382,5 +386,7 @@
 }
 
-func (PS *PgeSearch) SingleStep2() {
+
+func (PS *PgeSearch) Step() int {
+
 	loop := 0
 	eval_cnt := 0 // for channeled eval
@@ -389,5 +395,8 @@
 
 	ex := PS.expandPeeled(es)
-
+	
+	cnt_ins := 0
+
+	inserts := make(probs.ExprReportArray, 0)
 	for cnt := range ex {
 		E := ex[cnt]
@@ -414,226 +423,7 @@
 
 			// for serial eval
-			// re := RegressExpr(e, PS.prob)
-
-			// start channeled eval
-			PS.eval_in <- e
-			eval_cnt++
-		}
-	}
-	for i := 0; i < eval_cnt; i++ {
-		re := <-PS.eval_out
-		// end channeled eval
-
-		// check for NaN/Inf in re.error  and  if so, skip
-		if math.IsNaN(re.TestError()) || math.IsInf(re.TestError(), 0) {
-			// fmt.Printf("Bad Error\n%v\n", re)
-			continue
-		}
-
-		if re.TestError() < PS.minError {
-			PS.minError = re.TestError()
-		}
-
-		// check for coeff == 0
-		doIns := true
-		for _, c := range re.Coeff() {
-			// i > 0 for free coeff
-			if math.Abs(c) < PS.cnfg.zeroEpsilon {
-				doIns = false
-				break
-			}
-		}
-		
-		if doIns {
-			re.SetProcID(PS.id)
-			re.SetIterID(PS.iter)
-			re.SetUnitID(loop)
-			re.SetUniqID(PS.neqns)
-			loop++
-			PS.neqns++
+			//re := RegressExpr(e, PS.prob) //needed for TestScore calc via RegressExpr
+			//inserts = append(inserts, re)
 			
-			//fmt.Printf("SS2Queue.Push(): %v\n%v\n\n", re.Expr(), serial)
-			////fmt.Printf("INSQueue.Push(): %v\n", re)
-			////fmt.Printf("INSQueue.Push(): %v\n", re.Expr())
-
-			PS.Queue.Push(re)
-
-		}
-	}
-	// } // for sequential eval
-	PS.Queue.Sort()																																																																				
-}
-
-//Problem
-func (PS *PgeSearch) SingleStep() []*PeelResult {
-	if os.Getenv("PGEDEBUG") == "1" {
-		fmt.Printf("Init PgeSearch: %#v \n", PS)
-		fmt.Printf("Init PgeProblem: %#v \n", PS.prob)
-	}
-
-
-	loop := 0
-	eval_cnt := 0
-	PR := PS.peelRes()
-	
-	es := make([]*probs.ExprReport, len(PR))
-	
-	for i, elem := range PR {
-    if(elem != nil) {
-			es[i] = elem.ExpreRe
-		//} else {
-    //  es[i] = new(probs.ExprReport)
-    }
-	}
-	
-	ex := PS.expandPeeled(es)
-
-	for cnt := range ex {
-		E := ex[cnt]
-		if E == nil {
-			continue
-		}
-		for _, e := range E {
-			if e == nil {
-				continue
-			}
-			if !PS.cnfg.treecfg.CheckExpr(e) {
-				continue
-			}
-			serial := make([]int, 0, 64)
-			serial = e.Serial(serial)
-			ins := PS.Trie.InsertSerial(serial)
-			
-			if !ins {
-				continue
-			}
-			PS.eval_in <- e
-			eval_cnt++
-		}
-	}
-	for i := 0; i < eval_cnt; i++ {
-		re := <-PS.eval_out
-		if math.IsNaN(re.TestError()) || math.IsInf(re.TestError(), 0) {
-			continue
-		}
-		if re.TestError() < PS.minError {
-			PS.minError = re.TestError()
-		}
-		doIns := true
-		for _, c := range re.Coeff() {
-			if math.Abs(c) < PS.cnfg.zeroEpsilon {
-				doIns = false
-				break
-			}
-		}
-		if doIns {
-			re.SetProcID(PS.id)
-			re.SetIterID(PS.iter)
-			re.SetUnitID(loop)
-			re.SetUniqID(PS.neqns)
-			loop++
-			PS.neqns++
-			PS.Queue.Push(re)
-		}
-	}
-	PS.Queue.Sort()
-
-	PS.reportExpr()	
-	PS.iter++
-	
-	return PR
-}
-
-//Problem
-func (PS *PgeSearch) peelRes() []*PeelResult {
-	//es := make([]*probs.ExprReport, PS.cnfg.peelCnt)
-	PRes := make([]*PeelResult, PS.cnfg.peelCnt)
-	
-	for p := 0; p < PS.cnfg.peelCnt && PS.Queue.Len() > 0; p++ {
-		PR := new(PeelResult)
-			
-		PR.BestNewMinErr = false
-		PR.Nobestpush = false
-		
-		e := PS.Queue.Pop().(*probs.ExprReport)
-		
-		bPush := true
-		if len(e.Coeff()) == 1 && math.Abs(e.Coeff()[0]) < PS.cnfg.zeroEpsilon {
-			//fmt.Println("No Best Push")
-			PR.Nobestpush = true
-			p--
-			continue
-		}
-
-		if bPush {
-			//fmt.Printf("pop/push (%d,%d): %v\n", p, PS.Best.Len(), e.Expr())
-			PS.Best.Push(e)
-		}
-
-		//es[p] = e
-    PR.Bestlen1 = p
-		PR.Bestlen2 = PS.Best.Len()
-		PR.Expre = e.Expr()
-		PR.ExpreRe = e
-		PR.Es = e
-		PR.Coeff = e.Coeff()
-		PR.TestScore = e.TestScore()
-		
-		
-		if e.TestScore() > PS.maxScore {
-			PS.maxScore = e.TestScore()
-		}
-		if e.TestError() < PS.minError {
-			PS.minError = e.TestError()
-			PR.BestNewMinErr = true
-			//fmt.Printf("Best New Min Error:  %v\n", e)
-		}
-		if e.Size() > PS.maxSize {
-			PS.maxSize = e.Size()
-		}
-		
-		PRes[p] = PR
-	}
-	
-	return PRes
-}
-
-func (PS *PgeSearch) Step() int {
-
-	loop := 0
-	eval_cnt := 0 // for channeled eval
-
-	es := PS.peel()
-
-	ex := PS.expandPeeled(es)
-	
-	cnt_ins := 0
-
-	for cnt := range ex {
-		E := ex[cnt]
-
-		if E == nil {
-			continue
-		}
-
-		for _, e := range E {
-			if e == nil {
-				continue
-			}
-			if !PS.cnfg.treecfg.CheckExpr(e) {
-				continue
-			}
-
-			// check ipre_trie
-			serial := make([]int, 0, 64)
-			serial = e.Serial(serial)
-			ins := PS.Trie.InsertSerial(serial)
-			if !ins {
-				continue
-			}
-
-			// for serial eval
-			// re := RegressExpr(e, PS.prob)
-
 			// start channeled eval
 			PS.eval_in <- e
@@ -681,12 +471,28 @@
 			cnt_ins++
 			PS.Queue.Push(re)
-		}
-	}
-	// } // for sequential eval
-	PS.Queue.Sort()
-
+			//fmt.Printf("Testscore: %v\n", re.TestScore())
+			//PS.commup.Rpts <- &re			//sort missing! > 3 ergs
+		}
+	}
+
+	PS.Queue.Sort()	//3 besten werden beim naechsten peel ausgegeben
+	
+	for p := 0; p < PS.cnfg.peelCnt && PS.Queue.Len() > 0; p++ { 	
+		val := PS.Queue.Pop().(*probs.ExprReport)
+		inserts = append(inserts, val)
+	}
+	
+	for _, e := range inserts {
+		PS.Queue.Push(e)
+	}	
+		
+	PS.Queue.Sort()	
+	
+	PS.commup.Res <- &inserts
+	
+	PS.reportExpr()
 	PS.iter++
-	PS.reportExpr() //new
-	return 3
+	
+	return len(inserts)
 }
 
@@ -702,5 +508,5 @@
 		bPush := true
 		if len(e.Coeff()) == 1 && math.Abs(e.Coeff()[0]) < PS.cnfg.zeroEpsilon {
-			////fmt.Println("No Best Push")
+			fmt.Println("No Best Push")
 			p--
 			continue
@@ -716,9 +522,10 @@
 
 		if e.TestScore() > PS.maxScore {
+			fmt.Printf("Testscore: %v\n", e.TestScore())
 			PS.maxScore = e.TestScore()
 		}
 		if e.TestError() < PS.minError {
 			PS.minError = e.TestError()
-			////fmt.Printf("Best New Min Error:  %v\n", e)
+			fmt.Printf("Best New Min Error:  %v\n", e)
 		}
 		if e.Size() > PS.maxSize {
@@ -727,5 +534,10 @@
 		
 	}
-	PS.commup.Rpts <- &rpt
+	
+	//fmt.Printf("sand %d best pushes in peel\n", len(rpt))
+	//PS.commup.Res <- &rpt
+	
+	_ = rpt
+	
 	return es
 }
@@ -755,16 +567,16 @@
 }
 
-//Hier ist das pgeRpt problem, liefert immer die besten pgerpt cnt ergebnisse zurck und ich schneide aus arrazy, werden auch unsortiert
+//Hier ist das pgeRpt problem, liefert immer die besten pgerpt cnt ergebnisse zurueck
 // //*
-func (PS *PgeSearch) reportExpr() int {
-	//PS.cnfg.pgeRptCount++
+func (PS *PgeSearch) reportExpr() {
+
 	cnt := PS.cnfg.pgeRptCount
-	//*PS.Best.Sort()
+	PS.Best.Sort()
 
 	// repot best equations
 	rpt := make(probs.ExprReportArray, cnt)
-	//*if PS.Best.Len() < cnt {
-	//*	cnt = PS.Best.Len()
-	//*}
+	if PS.Best.Len() < cnt {
+		cnt = PS.Best.Len()
+	}
 	copy(rpt, PS.Best.GetQueue()[:cnt])
 
@@ -779,5 +591,5 @@
 	}
 
-	////fmt.Printf("Iter: %d  %f  %f\n", PS.iter, errSum/float64(errCnt), PS.minError)
+	PS.mainLog.Printf("Iter: %d  %f  %f\n", PS.iter, errSum/float64(errCnt), PS.minError)
 
 	PS.ipreLog.Println(PS.iter, PS.neqns, PS.Trie.cnt, PS.Trie.vst)
@@ -785,6 +597,9 @@
 
 	//PS.commup.Rpts <- &rpt
-	
-	return errCnt
+
+}
+
+func (PS *PgeSearch) FirstPeel() {
+	PS.peel()
 }
 
@@ -869,14 +684,8 @@
 	if len(guess) > 0 {
 
-		//fmt.Printf("IMREGEXP %v %v\n", P.SearchType, P.SearchVar)
-		//fmt.Printf("REGPTrain %T | %#v | %v\n", P.Train, P.Train, P.Train)
-		//fmt.Printf("eqn %T | %#v | %v\n", eqn, eqn, eqn)
-		//fmt.Printf("guess %T | %#v | %v\n", guess, guess, guess)
+		// fmt.Printf("x_dims:  %d  %d\n", x_dim, x_dim2)
 
 		// Callback version
-		
-		
 		coeff = levmar.LevmarExpr(eqn, P.SearchVar, P.SearchType, guess, P.Train, P.Test)
-		
 
 		// Stack version
@@ -911,5 +720,4 @@
 	R = new(probs.ExprReport)
 	R.SetExpr(eqn) /*.ConvertToConstantFs(coeff)*/
-
 	R.SetCoeff(coeff)
 	R.Expr().CalcExprStats()
@@ -980,5 +788,5 @@
 
 func (PS *PgeSearch) CreateDS(maxGen int, pgeRptEpoch int, pgeRptCount int, pgeArchiveCap int, peelCnt int, evalrCount int, zeroEpsilon float64, initMethod string, growMethod string, sortType int) {
-	PS.id = 0 //maxGen
+	PS.id = 0 //maxGen ? wieso steht des do, id -> procId bei multi searches
 	
 	var PC PgeConfig
@@ -1001,5 +809,5 @@
 	PC.maxGen = maxGen
 	PS.cnfg = PC
-	//PS.Stop = false is in init
+	PS.stop = false //is in init
 	PS.iter = 0
 }
@@ -1011,2 +819,225 @@
 	return PS.iter
 }
+
+
+
+
+/********************** DELETED ************************/ 
+
+
+func (PS *PgeSearch) SingleStep22() {
+	loop := 0
+	eval_cnt := 0 // for channeled eval
+
+	es := PS.peel()
+
+	ex := PS.expandPeeled(es)
+
+	for cnt := range ex {
+		E := ex[cnt]
+
+		if E == nil {
+			continue
+		}
+
+		for _, e := range E {
+			if e == nil {
+				continue
+			}
+			if !PS.cnfg.treecfg.CheckExpr(e) {
+				continue
+			}
+
+			// check ipre_trie
+			serial := make([]int, 0, 64)
+			serial = e.Serial(serial)
+			ins := PS.Trie.InsertSerial(serial)
+			if !ins {
+				continue
+			}
+
+			// for serial eval
+			// re := RegressExpr(e, PS.prob)
+
+			// start channeled eval
+			PS.eval_in <- e
+			eval_cnt++
+		}
+	}
+	for i := 0; i < eval_cnt; i++ {
+		re := <-PS.eval_out
+		// end channeled eval
+
+		// check for NaN/Inf in re.error  and  if so, skip
+		if math.IsNaN(re.TestError()) || math.IsInf(re.TestError(), 0) {
+			// fmt.Printf("Bad Error\n%v\n", re)
+			continue
+		}
+
+		if re.TestError() < PS.minError {
+			PS.minError = re.TestError()
+		}
+
+		// check for coeff == 0
+		doIns := true
+		for _, c := range re.Coeff() {
+			// i > 0 for free coeff
+			if math.Abs(c) < PS.cnfg.zeroEpsilon {
+				doIns = false
+				break
+			}
+		}
+		
+		if doIns {
+			re.SetProcID(PS.id)
+			re.SetIterID(PS.iter)
+			re.SetUnitID(loop)
+			re.SetUniqID(PS.neqns)
+			loop++
+			PS.neqns++
+			
+			//fmt.Printf("SS2Queue.Push(): %v\n%v\n\n", re.Expr(), serial)
+			////fmt.Printf("INSQueue.Push(): %v\n", re)
+			////fmt.Printf("INSQueue.Push(): %v\n", re.Expr())
+
+			PS.Queue.Push(re)
+
+		}
+	}
+	// } // for sequential eval
+	PS.Queue.Sort()																																																																				
+}
+
+//Problem
+func (PS *PgeSearch) SingleStep2() []*PeelResult {
+	if os.Getenv("PGEDEBUG") == "1" {
+		fmt.Printf("Init PgeSearch: %#v \n", PS)
+		fmt.Printf("Init PgeProblem: %#v \n", PS.prob)
+	}
+
+
+	loop := 0
+	eval_cnt := 0
+	PR := PS.peelRes2()
+	
+	es := make([]*probs.ExprReport, len(PR))
+	
+	for i, elem := range PR {
+    if(elem != nil) {
+			es[i] = elem.ExpreRe
+		//} else {
+    //  es[i] = new(probs.ExprReport)
+    }
+	}
+	
+	ex := PS.expandPeeled(es)
+
+	for cnt := range ex {
+		E := ex[cnt]
+		if E == nil {
+			continue
+		}
+		for _, e := range E {
+			if e == nil {
+				continue
+			}
+			if !PS.cnfg.treecfg.CheckExpr(e) {
+				continue
+			}
+			serial := make([]int, 0, 64)
+			serial = e.Serial(serial)
+			ins := PS.Trie.InsertSerial(serial)
+			
+			if !ins {
+				continue
+			}
+			PS.eval_in <- e
+			eval_cnt++
+		}
+	}
+	for i := 0; i < eval_cnt; i++ {
+		re := <-PS.eval_out
+		if math.IsNaN(re.TestError()) || math.IsInf(re.TestError(), 0) {
+			continue
+		}
+		if re.TestError() < PS.minError {
+			PS.minError = re.TestError()
+		}
+		doIns := true
+		for _, c := range re.Coeff() {
+			if math.Abs(c) < PS.cnfg.zeroEpsilon {
+				doIns = false
+				break
+			}
+		}
+		if doIns {
+			re.SetProcID(PS.id)
+			re.SetIterID(PS.iter)
+			re.SetUnitID(loop)
+			re.SetUniqID(PS.neqns)
+			loop++
+			PS.neqns++
+			PS.Queue.Push(re)
+		}
+	}
+	PS.Queue.Sort()
+
+	PS.reportExpr()	
+	PS.iter++
+	
+	return PR
+}
+
+//Problem
+func (PS *PgeSearch) peelRes2() []*PeelResult {
+	//es := make([]*probs.ExprReport, PS.cnfg.peelCnt)
+	PRes := make([]*PeelResult, PS.cnfg.peelCnt)
+	
+	for p := 0; p < PS.cnfg.peelCnt && PS.Queue.Len() > 0; p++ {
+		PR := new(PeelResult)
+			
+		PR.BestNewMinErr = false
+		PR.Nobestpush = false
+		
+		e := PS.Queue.Pop().(*probs.ExprReport)
+		
+		bPush := true
+		if len(e.Coeff()) == 1 && math.Abs(e.Coeff()[0]) < PS.cnfg.zeroEpsilon {
+			//fmt.Println("No Best Push")
+			PR.Nobestpush = true
+			p--
+			continue
+		}
+
+		if bPush {
+			//fmt.Printf("pop/push (%d,%d): %v\n", p, PS.Best.Len(), e.Expr())
+			PS.Best.Push(e)
+		}
+
+		//es[p] = e
+		PR.Bestlen1 = p
+		PR.Bestlen2 = PS.Best.Len()
+		PR.Expre = e.Expr()
+		PR.ExpreRe = e
+		PR.Es = e
+		PR.Coeff = e.Coeff()
+		PR.TestScore = e.TestScore()
+		
+		
+		if e.TestScore() > PS.maxScore {
+			PS.maxScore = e.TestScore()
+		}
+		if e.TestError() < PS.minError {
+			PS.minError = e.TestError()
+			PR.BestNewMinErr = true
+			//fmt.Printf("Best New Min Error:  %v\n", e)
+		}
+		if e.Size() > PS.maxSize {
+			PS.maxSize = e.Size()
+		}
+		
+		PRes[p] = PR
+	}
+	
+	return PRes
+}
Index: branches/2929_PrioritizedGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.PGE/3.3/list.c
===================================================================
--- branches/2929_PrioritizedGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.PGE/3.3/list.c	(revision 16615)
+++ branches/2929_PrioritizedGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.PGE/3.3/list.c	(revision 16615)
@@ -0,0 +1,76 @@
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+//#define DEBUG
+#define MAX_CHAR 255
+
+typedef struct node {
+   void *data;      //config values
+   char *name;      //config key
+   struct node *next;
+} node;
+
+static node *head = NULL;
+
+void configPrint() {
+   node *cNode = head;
+   while(cNode != NULL) {        
+      printf("Config Entry: %s\n",cNode->name);
+      cNode = cNode->next;
+   }
+}
+
+void* configGet(char *name) {
+   node *cNode = head;
+   while(cNode != NULL && strcmp(cNode->name, name) != 0) {
+      cNode = cNode->next;
+   }
+   if(cNode == NULL) {
+      #ifdef DEBUG
+         char msg[MAX_CHAR];
+         strcpy(msg, "Configsetting not found: ");
+         perror(strcat(msg, name));
+      #endif
+      return NULL;
+   } else {
+      return(void*)cNode->data;
+   }
+}
+
+void configDispose() {
+   node *cNode = head;
+   while(cNode != NULL) {        
+      node *nextN = cNode->next;
+      free(cNode->data);
+      cNode->data = NULL;
+      free(cNode->name);
+      cNode->name = NULL;
+      free(cNode);
+      cNode = nextN;
+   }
+   head = NULL;
+}
+
+void configPrepend(char *key, void *data) {
+   node *n = (node *) malloc(sizeof(node));
+   n->data = data;
+   n->name = key;
+   n->next = head;
+   head = n;
+}
+
+
+void configTest() {
+    configPrepend("pge", (void *) 10);
+    configPrepend("key2", (void *) 20);
+    configPrepend("key3", (void *)30);
+    configPrepend("key4", (void *)1);
+    configPrepend("key5", (void *) 40);
+    configPrepend("key6", (void *)56); 
+
+    printf("Found %d\n", *(int *)configGet("key4"));
+    printf("Found %d\n", *(int *)configGet("key6"));
+    printf("Found %d\n", *(int *)configGet("pge"));
+    printf("Found %d\n", *(int *)configGet("nix"));
+}
