private void handleAckEvent(AckEvent event) {
    SampleProcess p_j = correct.getProcess((SocketAddress) event.source);
    int reg = event.getMessage().popInt();

    writeSet.get(reg).add(p_j);

    debugAll("handleAck");

    allCorrect();
  }
  private void handleWriteEvent(WriteEvent event) {
    int reg = event.getMessage().popInt();
    Object val = event.getMessage().popObject();

    value[reg] = val;

    try {
      AckEvent ev = new AckEvent(pp2pchannel, Direction.DOWN, this);
      ev.getMessage().pushInt(reg);
      ev.dest = event.source;
      ev.go();
    } catch (AppiaEventException ex) {
      ex.printStackTrace();
    }
  }