public synchronized int cancelFewOrders(Iterable<String> array) {
        int notCancelled = 0;
        for (String id : array) {
            privateCancelOrder.setOrder_id(id);
            if (!privateCancelOrder.runMethod()) {
                try {
                    Thread.sleep(500);
                } catch (InterruptedException e) {
                }
                if (!privateCancelOrder.runMethod()) {
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                    }
                    if (!privateCancelOrder.runMethod()) {
                        notCancelled++;
                    }
                }
            }
        }
        return notCancelled;
    }