public void undoMove() {
		
		int undo = moves.get(locate_prev_move);
		String[] string_moves = {"F"   , "F2"    , "F'"  , "F'2"   , /*NOT USED DIRECTLY*/ "F"   , "F2"    ,
								 "R"   , "R2"    , "R'"  , "R'2"   , /*NOT USED DIRECTLY*/ "R"   , "R2"    ,
								 "B"   , "B2"    , "B'"  , "B'2"   , /*NOT USED DIRECTLY*/ "B"   , "B2"    ,
								 "L"   , "L2"    , "L'"  , "L'2"   , /*NOT USED DIRECTLY*/ "L"   , "L2"    ,
								 "U"   , "U2"    , "U'"  , "U'2"   , /*NOT USED DIRECTLY*/ "U"   , "U2"    ,
								 "D"   , "D2"    , "D'"  , "D'2"   , /*NOT USED DIRECTLY*/ "D"   , "D2"    ,
								 "U D'", "U2 D'2", "U' D", "U'2 D2", /*NOT USED DIRECTLY*/ "U D'", "U2 D'2",
								 "L R'", "L2 R'2", "L' R", "L'2 R2", /*NOT USED DIRECTLY*/ "L R'", "L2 R'2"
								};
		
		user_move = false;
		goToLayout(last_layout);
		
		if(!string_moves[undo].contains("2")) { //Checks if the move recorded was not a double move
			locate_prev_move--;
			
			//Checks if the move is not inverted
			if(!string_moves[undo].contains("'")) {callMove(undo+2);}
			else                                  {callMove(undo-2);}
			
			String[] string = new String[moves.size()];
			Color [] color  = new Color [moves.size()];
			Font     font   = new Font("Arial", Font.BOLD, 12);
			
			for(int i=0;i<locate_prev_move+1;i++) { //For moves that have been made
				 string[i] = string_moves[moves.get(i)] + " ";
				 color [i] = Color.WHITE;
			}
			
			for(int i=locate_prev_move+1;i<moves.size();i++) { //For moves that have been undid
				 string[i] = string_moves[moves.get(i)] + " ";
				 color [i] = Color.GRAY.darker();
			}
			
			moves_box.setText(string, color, font);	
			repaint();
		
		} else { //The move is a double move
			//Checks if the move is not inverted
			if(!string_moves[undo].contains("'")) {callMove(undo+2);}
			else                                  {callMove(undo-2);}
			
			if(moves_box.getColor(locate_prev_move).equals(Color.WHITE)) { //Check if no part of the double move has been undid
				String[] string = new String[moves.size()+1];
				Color [] color  = new Color [moves.size()+1];
				Font     font   = new Font("Arial", Font.BOLD, 12);
				
				for(int i=0;i<locate_prev_move+1;i++) { //For moves that have been made
					 string[i] = string_moves[moves.get(i)] + " ";
					 color [i] = Color.WHITE;
				}
				
				string[locate_prev_move+1] = string_moves[moves.get(locate_prev_move+1)].substring(0, string_moves[moves.get(locate_prev_move+1)].length()-1);
				color [locate_prev_move+1] = Color.WHITE;
				
				string[locate_prev_move+2] = "2";
				color [locate_prev_move+2] = Color.GRAY.darker();
				
				for(int i=locate_prev_move+3;i<moves.size();i++) { //For moves that have been undid
					 string[i] = string_moves[moves.get(i)] + " ";
					 color [i] = Color.GRAY.darker();
				}
				
				moves_box.setText(string, color, font);	
				repaint();
				
			} else { //The second part of the double has been undid
				locate_prev_move--;
				
				String[] string = new String[moves.size()+1];
				Color [] color  = new Color [moves.size()+1];
				Font     font   = new Font("Arial", Font.BOLD, 12);
				
				for(int i=0;i<locate_prev_move+1;i++) { //For moves that have been made
					 string[i] = string_moves[moves.get(i)] + " ";
					 color [i] = Color.WHITE;
				}
				
				for(int i=locate_prev_move+1;i<moves.size();i++) { //For moves that have been undid
					 string[i] = string_moves[moves.get(i)] + " ";
					 color [i] = Color.GRAY.darker();
				}
				
				moves_box.setText(string, color, font);	
				repaint();
				
			}
			
			
		}
		
		
	}