                 maxm1.write(1);
                 maxm1.write(0);
                 maxm1.stop();
-            }
-            scheduler.timer(MAXM2, maxm2_offset * 10);
-            scheduler.timer(MAXM1, 900);
+            } 
             break;
 
         // Control second MaxM
         case MAXM2:
-            if  (is_operational != 1) break;
             maxm2.send();
             maxm2.write('p');
             maxm2.write(0);

// LEDs are on port 4
Port ledPort (4);

int is_operational = 0;

long start_min = 0;
long stop_min = 0;

            // Get time
            DateTime now = RTC.now();

            // Check every check_cycle seconds
            int sec_til_check = check_cycle - (now.get() % check_cycle);
            scheduler.timer(OPER_TIME, sec_til_check * 10);

#ifdef DEBUG_TRACE
            Serial.print("RTC time: ");
            Serial.print(now.year());
            Serial.print('-');
            Serial.print(now.month());
            Serial.print('-');
            Serial.print(now.day());
            Serial.print(' ');
            Serial.print(now.hour());
            Serial.print(':');
            Serial.print(now.minute());
            Serial.print(':');
            Serial.print(now.second());
            Serial.print(" dow: ");
            Serial.println(now.dayOfWeek());
            Serial.flush();
#endif
            // Check if should be operational and set flag 
            long cur_min = toMin(now.hour(), now.minute());
            if ((cur_min >= start_min) && (cur_min < stop_min))  {
                is_operational = 1;
                // Start the MAXM1 task if not already active
                if (maxm1_active == 0) {
                  scheduler.timer(MAXM1, 0);
                  maxm1_active = 1;
                }
#ifdef DEBUG_TRACE
                Serial.println("Lights are operational");
                Serial.flush();
#endif
            } else {
                is_operational = 0;
                maxm1_active = 0;
                //TODO consider turning off MaxMs like in setup()
#ifdef DEBUG_TRACE
                Serial.println("Lights are sleeping");
                Serial.flush();
#endif
            }

            // Flash LED2 one for every minute
            doFlash(ledPort, led2, 1);
            break;
    }
}
