void turn() {
        if (whichIndex == 0) {
            whichIndex = 1;
            step = step * -1;
        }
        else {
            whichIndex = 0;
        }
        max[whichIndex]--;
        if (max[whichIndex] <= 0)
            closed = true;
    }