print str(node.clusterHead[0])
                #print node.network

                tempNet = []
                for tempNode in node.network:
                    if node.calculateCoor(node.clusterHead[2], tempNode[2]):
                        tempNet.append(tempNode)
                node.network = tempNet
                print 'Network after change: '

                print node.network
                print ' '
                
                # tell the BS the information of the network
		
                node.send(BS_addr, BS_port, MS_Handler.Encode_List_Info_Msg(node.network))
                # send information to the new cluster head to let him be the new cluster head
                for eachNode in node.network:

                    code=node.send(eachNode[0], PORT, MS_Handler.Encode_CH_Change_Msg(node.clusterHead[0],node.clusterHead[1],node.clusterHead[2]))
                    #print '++++++++++++++++'
                    #print code
                #timerUpdateHead=
                CH_start=0
        
            
            
            #elif (len(buff)==buffSize):
            #    node.send(BS_addr, BS_port, buff)
            #    lastSend = time.time()