public void scramble() {
		scrambling = true;
		numOfFrames = 5;
		new Thread(new Runnable() {

			@Override
			public void run() {
				Board previousBoard = null;
				while (scrambling) {
					Board board = new Board(gameBoard);
					List<Board> boardNeighbors = board.neighbors();
					int[][] nextBoard = getNewBoard(boardNeighbors,
							previousBoard);
					Point p = getZeroCoords(nextBoard);
					swap(p.x, p.y);
					while (animating) {
						try {
							Thread.sleep(amountToSleep);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
					}
					previousBoard = board;
				}
				numOfFrames = 10;
				repaint();
				if (checkIfSolved()) {
					scramble();
				}
			}

		}).start();
	}