public void paintComponent(Graphics g) {  
		
	       
		Graphics2D g2 = (Graphics2D) g;
		//Center everything
		int centerX = this.getWidth()/2;


		//Scale the hexagons so that the triangle takes up the panel
		hexRadius = (int)((this.getHeight()-centerY-50)/(this.totalRows*1.5));
		hexRadius = Math.min(hexRadius, (this.getWidth()-100)/(this.totalRows*2));

		//make the base hexagon shape
		int xPoints[] = {0, hexRadius,  hexRadius*2,  hexRadius*2, hexRadius, 0,0};
		int yPoints[] = {0, -hexRadius/2, 0, hexRadius, 3*hexRadius/2, hexRadius,0};
		GeneralPath hexagon = new GeneralPath(GeneralPath.WIND_EVEN_ODD, xPoints.length);
		hexagon.moveTo(xPoints[0], yPoints[0]);
		for (int index = 1; index < xPoints.length; index++) {
		    hexagon.lineTo(xPoints[index], yPoints[index]);
		};
		hexagon.closePath();

		// Adds Rectangles into ArrayList
		// The rectangles represent the area inside the hexagon
		// that contains the number
		squares = new ArrayList<Rectangle>();
		count = 0;
		for (int i = 0; i < totalRows; i++) { // i = rows
		    for (int j = 0; j <= i; j++) { // j = index within row
			squares.add(new Rectangle(centerX - hexRadius*2/2 + j*hexRadius*2 - i*hexRadius*2/2, 
						  centerY + i*hexRadius*3/2, hexRadius*2, hexRadius));
		        count++; 
		    }
		}

		// Draws the hexagons and numbers and fills them in appropriately
		for (int i = 0; i < count; i++) {
		    AffineTransform transform = new AffineTransform();
		    transform.translate(squares.get(i).getX(),squares.get(i).getY());
		    Shape movedHex = transform.createTransformedShape(hexagon);
		    g2.setColor(Color.BLACK); 
		    g2.setStroke(new BasicStroke((int)(Math.sqrt(hexRadius))));
		    g2.draw(movedHex);

		    g2.setColor(new Color(9,70,9));
		     
		    if (numbersInPascalTriangle[i] % 2 == 1){
			g2.setColor(new Color(129,201,130));
			g2.fill(movedHex);
			g2.setColor(new Color(2,63,2)); 
		    }
		    
		    String num = ""+numbersInPascalTriangle[i];
		    //make font scale with number length
		    g2.setFont(new Font("default", Font.BOLD, (int)(hexRadius*1.5*(1-.8*num.length()/6) ) ));

		    //center the number
		    FontMetrics metrics = g2.getFontMetrics();
		    Rectangle2D r = metrics.getStringBounds(num, g2);
		    g2.drawString(num, (int)(squares.get(i).getX() + squares.get(i).getWidth()/2 -r.getWidth()/2),
				  (int)squares.get(i).getY()+metrics.getAscent() + (int)(squares.get(i).getHeight() - r.getHeight())/2);
		}

    } // End Paint Method