@Override
    public void receive() {
        
        if(stopped){
            return;
        }
        if(round % 2 == 0){
            if("black".equals(super.input)){
                List<String> messages = receiveMessages();
                for (int i = 0; i < degree(); i++) {
                    if("matched".equals(messages.get(i))){
                        matchedNeighbours[i] = true;
                    }
                    if("proposal".equals(messages.get(i))){
                        proposals[i] = true;
                    }
                }
            }
        }
        else{
            if("white".equals(super.input)){
                List<String> messages = receiveMessages();
                for (int i = 0; i < degree(); i++) {
                    if("accept".equals(messages.get(i))){
                        matched = true;
                        setOutput(i);
                    }
                }
            }
        }
        round++;
        
    }