@Override
	public void run() {
		try {
			
			int increment = list.length / 2;
			while (increment > 0) {
				for (int i = increment; i < list.length; i++) {
					redColumn = i;
					int j = i;
					int temp = list[i];
					repaint();
					Thread.sleep(3 * sleepTime);
					while (j >= increment && list[j - increment] > temp) {
						blueColumn = j - increment;
						if(increment == 1) {
							greenColumn = blueColumn - 1;
						}
						repaint();
						Thread.sleep(4 * sleepTime);
						list[j] = list[j - increment];
						j = j - increment;
					}
					repaint();
					Thread.sleep(2 * sleepTime);
					list[j] = temp;
				}
				if (increment == 2) {
					increment = 1;
				} else {
					increment *= (5.0 / 11);
				}
				
			}
			redColumn = -1;
			blueColumn = -1;	
			greenColumn = size - 1;
		} catch (InterruptedException e) {
		}
		repaint();
	}