   /* Dump the configuration of the rf unit for debugging */
   if ( DEBUG ) radio.printDetails();
     
-  /* Initialize the LEDs, 10 is also SPI SS*/
+  /* Initialize the LEDs, D10 is also SPIs->SS */
   pinMode( 9, OUTPUT );
   pinMode( 10, OUTPUT   );
   digitalWrite( 9, LOW );

 * function to receive datapacket
 * return - 0 when reception was successful
 */
uint8_t receivePacket( struct Packet rx_packet ) {
  /* When we don't use timeout */
  if ( !radio.available() ) return NO_DATA;
  /* Read the data from the tranceiver */
  radio.read( &rx_packet, radio.getPayloadSize() );
  /* Only receive packets which are for us or broadcast packets for all clients */
  if ( rx_packet.destination != role_id && rx_packet.destination != client_all_id ) {
    debug_printf( "different destination %X source %X...", rx_packet.destination, rx_packet.source );
    return WRONG_DESTINATION;
  }
  debug_printf( "source %X...", rx_packet.source );
  return SUCCESS;
}


      uint8_t state = 0;
      /* Specify the command from serial */
      if ( command == 'w' || button == 1 ) state = WAITING_VOTING;
      else if ( command == 'a' || button == 2 ) state = ACTIVE_VOTING;
      else if ( command == 'f' || button == 3 ) state = FINISHED_VOTING;
      else if ( command == 'v' || button == 4 ) {
        /* Print the voting result, last value represents not voted count */
        printf( "%d,%d,%d,%d,%d\n", votes[0], votes[1], votes[2], votes[3], client_count - votes[0] - votes[1] - votes[2] - votes[3] );
        delay(100); 
      }
      /* When state was selected, send it to all the clients */
      if ( state != 0 ) { transmitPacket( client_all_id, VOTE_STATE, state ); delay( 100 ); }
    }
    
    /* Check for received packet */
    uint8_t rx_packet[PAYLOAD];
    uint8_t response = receivePacket( rx_packet );
    /* When responded with no data or wrong destination, don't process packet */
    if ( response == NO_DATA || response == WRONG_DESTINATION ) return;
    
    switch ( rx_packet[COMMAND] ) {
      /* When ID request was received, generate and send a new ID for the new client */
      case REQUEST_ID: 
        debug_printf( "id request\n" ); 
        transmitPacket( rx_packet[SOURCE], REQUEST_ACK, getNewClientID() ); 
        break;
      /* When vote was received, send ack back to the client */
      case VOTE_ID: 
        debug_printf( "button %X was pressed\n", rx_packet[DATA] );
        votes[rx_packet[DATA]-1] += 1;
        transmitPacket( rx_packet[SOURCE], VOTE_ACK, rx_packet[DATA] );
        break;
      /* When we received unknown command */
      default: 
        debug_printf( "unknown command received %X\n", rx_packet[COMMAND] ); 
        break;
    }
  }

}



