       filling = false;
       dln(valveDBG, " off");
     }
+    // dbg(valveDBG, "pump Pin = "); dbg(valveDBG, pumpMcpPin);
+    // dbg(valveDBG, ", solen = "); dln(valveDBG, solenoidMcpPin);
 
     lastFlip = millis();
   }
   void on()  { stateChange(true); }  // fill time
   void off() { stateChange(false); } // drain time
-  void step(monitor_t* now, char cycleMins) { // check conditions and adjust
-    if(!filling && startTime >= millis()) {   // time to start filling
+  void step(monitor_t* now, char cycleMins) {   // check conditions and adjust
+    dbg(valveDBG, "valve[].step - number = "); dln(valveDBG, number);
+    if(!filling && ( startTime >= millis() )) { // time to start filling
       on();
-      startTime = startTime += (cycleMins * 60 * 1000);
+      startTime += (cycleMins * 60 * 1000);
+      dbg(valveDBG, "startTime = "); dln(valveDBG, startTime);
     }
     if(full(now))                    // we're full
       off();
   }
-  int full(monitor_t *now) {
+  bool full(monitor_t *now) {
+    int l = -1;
     switch(number) {
-      case 1: return ( now->waterLevel1 <= fillLevel );
-      case 2: return ( now->waterLevel2 <= fillLevel );
-      case 3: return ( now->waterLevel3 <= fillLevel );
-      default: return -1;
-    }
+      case 1: l = now->waterLevel1; break;
+      case 2: l = now->waterLevel2; break;
+      case 3: l = now->waterLevel3; break;
+    }
+    dbg(valveDBG, "now->waterLevel = "); dln(valveDBG, l);
+    return ( l <= fillLevel );
   }
 };
 int Valve::counter = 1;         // definition (the above only declares)
 
 class FlowController { // the set of valves and their config ////////////////
   public:
-  int numValves = 3;            // WARNING! call init if resetting!
-  char cycleMins = 6;//TODO    // how long is a flood/drain cycle?
-  char maxSimultDrainers = 1;   // how many beds can drain simultaneously?
-  char minBedsWet = 1;          // min beds that are full or filling
-  char maxBedsWet = 2;          // max beds that are full or filling
-  char staggerMins;             // gap to leave between valve startups
-  Valve* valves = 0;            // the valves and their states
-
-  FlowController() { init(); }
+  int numValves = 3;         // WARNING! call init if resetting!
+  int cycleMins = 6;//TODO   // how long is a flood/drain cycle?
+  int maxSimultDrainers = 1; // how many beds can drain simultaneously?
+  int minBedsWet = 1;        // min beds that are full or filling
+  int maxBedsWet = 2;        // max beds that are full or filling
+  int staggerMins;           // gap to leave between valve startups
+  Valve* valves = 0;         // the valves and their states
+
   int getStaggerMillis() { return staggerMins * 60 * 1000; }
   void init() {
     Valve::counter = 1;

  webServer.on("/valve2", handle_valve2);
  webServer.on("/valve3", handle_valve3);
  webServer.begin();
  dln(netDBG, "HTTP server started");
}
void handleNotFound() {
  dbg(netDBG, "URI Not Found: ");


    // set up staggered valve starts
    staggerMins = cycleMins / numValves;
    dbg(valveDBG, "cycleMins = "); dbg(valveDBG, cycleMins);
    dbg(valveDBG, " staggerMins = "); dln(valveDBG, staggerMins);
    long t = millis();
    dbg(valveDBG, "millis = "); dln(valveDBG, t);
    long nextCycleStart = t;
    for(int i = 0; i < numValves; i++) {
      valves[i].startTime = nextCycleStart;
      dbg(valveDBG, "valves["); dbg(valveDBG, i);
      dbg(valveDBG, "].startTime = "); dln(valveDBG, nextCycleStart);
      nextCycleStart += getStaggerMillis();
    }
  }
