public void shuttleSort(boolean printpasses) {
        for (int pass = 1; pass < elements.length; pass++) {
            for (int i = pass; i > 0; i--) {
                T current = elements[i];
                T other = elements[i - 1];
                int compResult = current.compareTo(other);
                if (compResult > 0) { //current is larger
                    break;
                }
                if (compResult < 0) { //current is smaller
                    elements[i - 1] = current;
                    elements[i] = other;
                }
            }
            if (printpasses) {
                System.out.println(this);
            }
        }
    }