public void sort(SortArray a, SortCanvas c)  {
		int j;
		int limit = a.length();
		int st = 0;
		while (st < limit) {
			boolean flipped = false;
			st++;
			limit--;
			for (j = st; j < limit; j++) {
				if (a.greater(j, j + 1)) {
					a.swap(j, j+1);
					flipped = true;
				}
				c.paintNumbers();
			}
			if (!flipped) {
				return;
			}
			for (j = limit; --j >= st;) {
				if (a.greater(j, j + 1)) {
					a.swap(j, j+1);
					flipped = true;
				}
				c.paintNumbers();
			}
			if (!flipped) {
				return;
			}
		}
	}