@Override
    public void perform() {
        Integer top = 0;
        Integer bot = 0;

        Boolean swapped = false;
        do {
            swapped = false;
            for (int i = 1 + bot; i != this.main.getNumbers().size() - top; i++) {
                this.main.compare(i - 1, i);
                if (this.main.getNumbers().get(i - 1) > this.main.getNumbers().get(i)) {
                    this.main.swap(i - 1, i);
                    swapped = true;
                }
            }
            if (!swapped) {
                break;
            }
            top++;
            swapped = false;
            for (int i = this.main.getNumbers().size() - 1 - top; i != bot; i--) {
                this.main.compare(i - 1, i);
                if (this.main.getNumbers().get(i - 1) > this.main.getNumbers().get(i)) {
                    this.main.swap(i - 1, i);
                    swapped = true;
                }
            }
            bot++;
        } while (swapped);
    }