public void gridPressed(int row, int col) {
		
		int[]   settings = {row, col};
		int[]   nulled   = {-1, -1};
		boolean reset    = false;
		
		if(grid[0][0] == -1) {
			
			grid[0] = settings;
			for(int i=0;i<valid_moves.length;i++) {
				if(!(grid[0][0] == valid_moves[i][0] && grid[0][1] == valid_moves[i][1])) {
					reset = true;
				} else {
					main_grid.setColor(grid_lines[row-1][col-1], color_selected);
					reset = false;
					break;
				}
			}
			
		}
		
		else if(grid[1][0] == -1) {
				if(!(grid[0][0] == row && grid[0][1] == col)) {
					
					grid[1] = settings;
					for(int i=0;i<valid_moves.length;i++) {
						if(!(grid[1][0] == valid_moves[i][2] && grid[1][1] == valid_moves[i][3]) ||
						   !(grid[0][0] == valid_moves[i][0] && grid[0][1] == valid_moves[i][1])) {
							reset = true;
						} else {
							move = i+1;
							main_grid.setColor(grid_lines[row-1][col-1], color_selected);
							reset = false;
							break;
						}
					}
					
				} else {reset = true;}
		}
		
		else if(grid[2][0] == -1) {
				if(!(grid[0][0] == row && grid[0][1] == col) &&
				   !(grid[1][0] == row && grid[1][1] == col)) {
			
					grid[2] = settings;
					if(!(grid[2][0] == valid_moves[move-1][4] && grid[2][1] == valid_moves[move-1][5])) {
						reset = true;
					} else {
						main_grid.setColor(grid_lines[row-1][col-1], color_selected);
					}
				
				} else {reset = true;}
			
		}
		
		if(reset) {
			
			if(grid[0][0] != -1) {main_grid.setColor(grid_lines[grid[0][0]-1][grid[0][1]-1], color_incorrect);}
			if(grid[1][0] != -1) {main_grid.setColor(grid_lines[grid[1][0]-1][grid[1][1]-1], color_incorrect);}
			if(grid[2][0] != -1) {main_grid.setColor(grid_lines[grid[2][0]-1][grid[2][1]-1], color_incorrect);}
			
			grid[0] = nulled;
			grid[1] = nulled;
			grid[2] = nulled;
			
			repaint();
			
			Timer timer = new Timer(200, new ActionListener() {

				@Override
				public void actionPerformed(ActionEvent e) {
					main_grid.setColor(color_bg);
					repaint();
				}
				
			});
			
			timer.setRepeats(false);
			timer.start();
			
		} else if(grid[2][0] != -1) {
			
			user_move = true;
			
			main_grid.setColor(grid_lines[grid[0][0]-1][grid[0][1]-1], color_correct);
			main_grid.setColor(grid_lines[grid[1][0]-1][grid[1][1]-1], color_correct);
			main_grid.setColor(grid_lines[grid[2][0]-1][grid[2][1]-1], color_correct);
			repaint();
			
			final Cluster[] nulled_cluster = new Cluster[2];
			nulled_cluster[0] = new Cluster(-1);
			nulled_cluster[1] = new Cluster(-1);
			
			CTimer timer = new CTimer(200, nulled_cluster, new ActionListener() {
				
				@Override
				public void actionPerformed(ActionEvent e) {

					switch(move) {
					case 1 : dir = "Right";    break;
					case 2 : dir = "Right";    break;
					case 3 : dir = "Right";    break;
					case 4 : dir = "Left";     break;
				    case 5 : dir = "Left";     break;
					case 6 : dir = "Left";     break;
					case 7 : dir = "Down";     break;
					case 8 : dir = "Down";     break;
					case 9 : dir = "Down";     break;
					case 10: dir = "Up";       break;
					case 11: dir = "Up";       break;
					case 12: dir = "Up";       break;
					case 13: dir = "RotateC";  break;
					case 14: dir = "RotateC";  break;
					case 15: dir = "RotateC";  break;
					case 16: dir = "RotateC";  break;
					case 17: dir = "RotateAC"; break;
					case 18: dir = "RotateAC"; break;
					case 19: dir = "RotateAC"; break;
					case 20: dir = "RotateAC"; break;
					default:                   break;
					}
					
					shiftRubiks("F");
					main_grid.setColor(color_bg);
					
					for(int i=0;i<2;i++) {
						grid[0][i] = nulled_cluster[i].getInt();
						grid[1][i] = nulled_cluster[i].getInt();
						grid[2][i] = nulled_cluster[i].getInt();
					}
					
					repaint();
					
				}
				
			});
			
			timer.setRepeats(false);
			timer.start();
			
		} else {repaint();}
		
	}