public void optimizedGnomeSort() {
        int pos = 1;
        int last = 0;
        while (pos < this.numbers.size()) {

            if (this.numbers.get(pos) >= this.numbers.get(pos - 1)) {
                if (last != 0) {
                    pos = last;
                    last = 0;
                }

                pos++;
            } else {
                Integer temp = this.numbers.get(pos);//swapping
                this.numbers.set(pos, this.numbers.get(pos - 1));
                this.numbers.set(pos - 1, temp);
                if (pos > 1) {
                    if (last == 0) {
                        last = pos;
                    }
                    pos--;
                } else {
                    pos++;
                }
            }
        }
    }