       case METHOD_TABLE:
 	// calculate target
 	iTable=(struct convert *) conditions[i].target;
-	conditions[i].limit2->value=resolveConversion(value,conditions[i].limit->value,iTable);
-	float radReq=conditions[i].limit2->value;
-	if (!turnBypass(0,ts,radReq))
+	float target=resolveConversion(value,conditions[i].limit->value,iTable);
+	bp1.setTarget(target);
+	if (!bp1.turnBypass(ts))
 	  conditions[i].source->flags &= ~FLAGS_EVALUATE;
-
 	break;
       }
     }
   }
 }
-
-
-
-int turnBypass(int bno,time_t ts,float requested)
-{
-  int ret=1;
-  float diff;
-  long turntime;
-
-  bypasses[bno].targetAd=requested;
-  if (bypasses[bno].actualTemp->measured.analog==-273) return ret;
-
-  diff = requested - bypasses[bno].actualTemp->measured.analog;
-  turntime=abs(diff) * bypasses[bno].timeMultiplier;
-  Serial.print(" diff is ");
-  Serial.println(diff);
-  bypasses[bno].changed=ts;
-  if (turntime > bypasses[bno].maxTurntime)
-    turntime=bypasses[bno].maxTurntime;
-  else if (turntime < bypasses[bno].minTurntime)
-    turntime=bypasses[bno].minTurntime;
-
-  if (diff > bypasses[bno].hysteresis)
-    sched.oscillate(bypasses[bno].up,turntime,LOW,1);
-  else if (diff < (-1.0 * bypasses[bno].hysteresis))
-    sched.oscillate(bypasses[bno].dn,turntime,LOW,1);
-  else
-    ret=0;
-  return ret;
-}
-
 
 /* find boundings from conversion table
  * and convert / interpolate according to the table

  {5,"radiator",     0,0,     0,0.0, 0,0.3, 7,  21.0, 539,  36.5,  0,-273.0,  0,0.0}
};

struct bypassValve bypasses[]= {
  {"heating",&adArr[3],0,30,31,20.0,1000,30,0.3,800,10000}
};

// counters are kept in array, this for preparing to have more of them.



  for (int i=0;i<sizeof(conditions) / sizeof(struct condition);i++) {
    if (conditions[i].source == source) {
      conditions[i].last_chk = ts;
      value=source->measured.analog;
      limit=conditions[i].limit->value;
