private void doCommand(String cmd) {
        if (cmd.startsWith("D")) {
            currWaitDelay = Integer.parseInt(cmd.substring(1));
            previousProposal = new HashSet<Integer>(currentProposal);
            doDelay();
        } else if (cmd.startsWith("P")) {
            doPropose(cmd.substring(1).split("-"));
        } else if (cmd.startsWith("W")) {
            doWrite();
        } else if (cmd.startsWith("X")) {
            doShutdown();
        } else if (cmd.equals("help")) {
            doHelp();
        } else if (cmd.equals("$DONE")) {
            logger.info("DONE ALL OPERATIONS");
        } else {
            logger.info("Bad command: '{}'. Try 'help'", cmd);
        }
    }