private void makeCards() {
		int n = amount/2;
		for (int i = 0; i < n; i++) {
			// Final variable to be able to use it in the actionListener.
			final int in = i;
			cards[i] = new Card(img[i]);
			cards[i].addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					// Checks if the card has been clicked or not
					// If not clicked, the card is flipped.
					if(cards[in].ifClicked() == false){
						// Checks if it is the first or second card to be clicked.
						// Saves the card in the one of these variables or checks
						// if the two cards already clicked are a match.
						if(firstClicked == null) {
							firstClicked = cards[in];
							firstClicked.flip();
						} else if (secondClicked == null) {
							secondClicked = cards[in];
							secondClicked.flip();
						} else {
							match();
						}
					} else if (secondClicked != null) {
						match();
					}
				}
			});
			
			// Final variable to be able to use it in the actionListener.
			final int num = i + n;
			cards[i + n] = new Card(img[i]);
			cards[i + n].addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					// Checks if the card has been clicked or not.
					if(cards[num].ifClicked() == false) {
						// Checks if it is the first or second card to be clicked.
						// Saves the card in the one of these variables or checks
						// if the two cards already clicked are a match.
						if(firstClicked == null) {
							firstClicked = cards[num];
							firstClicked.flip();
						} else if (secondClicked == null) {
							secondClicked = cards[num];
							secondClicked.flip();
						} else {
							match();
						}
					} else if (secondClicked != null) {
						match();
					}
				}
			});
		}
	}