   Serial.end();
   #endif
 
-  //Configuration data for the node
+  /* Configuration data for the node */
   cbus.getNodeId()->setNodeName("MODSERV",7);  //node name
   cbus.getNodeId()->setModuleId(56);            //module number
   cbus.getNodeId()->setManufacturerId(0xA5);    //merg code

#include <EEPROM.h> //required by the library
#include <VarSpeedServo.h>

//uncomment this line to see debug messages
//#define DEBUGNODE

//Module definitions
#define NUM_SERVOS 8      //number of servos
//first 2 are to indicate which servo is on. 2 bytes to indicate to togle. 2 for start and end angle
#define VAR_PER_SERVO 6  //variables per servo
#define SPEED 50        //servo speed
#define SERVO_START 15        //servo start angle.start at 15 to avoid jitter
#define SERVO_END 180        //servo end angle


//CBUS definitions
#define GREEN_LED 8                  //merg green led port
#define YELLOW_LED 7                 //merg yellow led port
#define PUSH_BUTTON 9                //std merg push button

//Node definition
//number o node variables
#define NODE_VARS 2                  
//var1 = Servo speed
//var2 = flags
//flag1 (2 first bits) action to take on starting. see setupServos
//flag2 (bit 3), indicate to maintain the servo attached after moving. default is 0 = detached
#define SERVO_SPEED_VAR  1
#define SERVO_FLAGS_VAR  2 

#define NODE_EVENTS 30              //max number of events
#define EVENTS_VARS VAR_PER_SERVO   //number of variables per event
#define DEVICE_NUMBERS NUM_SERVOS   //number of device numbers. each servo can be a device
//the indexes start at 1 not at 0
#define ACTIVE_SERVO_VAR 1          //2 bytes for that
#define TOGLE_SERVO_VAR  3          //2 bytes for that
#define START_ANGLE_VAR  5          //var index for the start angle
#define END_ANGLE_VAR    6          //var index for the end angle


//create the merg object
MergCBUS cbus=MergCBUS(NODE_VARS,NODE_EVENTS,EVENTS_VARS,DEVICE_NUMBERS);

//servo controler
VarSpeedServo servos[NUM_SERVOS];

//pins where the servos are attached
//pins 9,10 and 15 don't work for many servos. servo library limitation
byte servopins[]={1,2,3,4,5,6,7,8};//,19,20,21,22,23,24,25,26,27,28,29,30};
byte active_servo[2]; //store the active servo event var
byte togle_servo[2]; //store the togle servo event var
boolean attach_servo = false;

  togle_servo[1]=mcbus->getEventVar(msg,TOGLE_SERVO_VAR + 1);
}

/* the the flags var and initialize them */
void initializeFlags(){
    byte flag = cbus.getNodeVar(SERVO_FLAGS_VAR);
    start_action = flag && 0x03; //first 2 bits    
