@Override
    public void perform() {
        this.main.saveScreen();
        int pos = 1;
        int last = 0;
        while (pos < this.numbers.size()) {
            this.main.compare(pos, pos - 1);
            if (this.numbers.get(pos) >= this.numbers.get(pos - 1)) {
                if (last != 0) {
                    pos = last;
                    last = 0;
                }
                pos++;
            } else {
                this.main.swap(pos, pos - 1);
                if (pos > 1) {
                    if (last == 0) {
                        last = pos;
                    }
                    pos--;
                } else {
                    pos++;
                }
            }
        }
    }