public void paintComponent(Graphics g) {
		super.paintComponent(g);
		Graphics2D g2d = (Graphics2D) g;
		g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
		g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
		g2d.drawImage(walls, 0, 0, null);
		g2d.drawImage(atoms, 0, 0, null);
        
		if (board[curRow][curCol] < 1)
			return;

		Composite c = g2d.getComposite();
		g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, (float) (1 - curAlpha * 0.05)));
		
		g2d.translate(curX + Element.SIDE / 2, curY + Element.SIDE / 2);
		g2d.rotate(curAngle);
		//g2d.rotate(curAngle, curX + Element.side / 2, curY + Element.side / 2);
		g2d.scale(curScale, curScale);
		g2d.drawImage(elements[board[curRow][curCol]].getImage(), -Element.SIDE / 2, -Element.SIDE / 2, null);
		g2d.scale(1 / curScale, 1 / curScale);
		//g2d.rotate(-curAngle, curX + Element.side / 2, curY + Element.side / 2);
		g2d.rotate(-curAngle);
		g2d.translate(-curX - Element.SIDE / 2, -curY - Element.SIDE / 2);
		
		g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, (float) (curAlpha * 0.05)));
		
		g2d.translate(finX + Element.SIDE / 2, finY + Element.SIDE / 2);
		g2d.rotate(curAngle);
		//g2d.rotate(curAngle, finX + Element.side / 2, finY + Element.side / 2);
		g2d.scale(curScale, curScale);
		g2d.drawImage(elements[board[curRow][curCol]].getImage(), -Element.SIDE / 2, -Element.SIDE / 2,  null);
		g2d.scale(1 / curScale, 1 / curScale);
		//g2d.rotate(-curAngle, finX + Element.side / 2, finY + Element.side / 2);
		g2d.rotate(-curAngle);
		g2d.translate(-finX - Element.SIDE / 2, -finY - Element.SIDE / 2);
		
		g2d.setComposite(c);
		
		if (!animating && !won) {
			if (board[curRow - 1][curCol] == 0) {
				g2d.drawImage(Element.ARROW_DOWN, curCol * Element.SIDE, (curRow - 1) * Element.SIDE, null);
			}
			if (board[curRow + 1][curCol] == 0) {
				g2d.drawImage(Element.ARROW_UP, curCol * Element.SIDE, (curRow + 1) * Element.SIDE, null);
			}
			if (board[curRow][curCol - 1] == 0) {
				g2d.drawImage(Element.ARROW_LEFT, (curCol - 1) * Element.SIDE, curRow * Element.SIDE, null);
			}
			if (board[curRow][curCol + 1] == 0) {
				g2d.drawImage(Element.ARROW_RIGHT, (curCol + 1) * Element.SIDE, curRow * Element.SIDE, null);
			}
		}
	}