public GeneralPath getGrid(int states) {
	    int[] bars = new int[2];
	    for (int count = states; count < 51; count++) {
		if (layout[count][0] > 0) {
		    bars = layout[count];
		    break;
		}
	    }
	    int maxCols = Math.max(bars[0], bars[1]);
	    int rows = 2;
	    int sum = bars[0] + bars[1];
	    while (sum < states) {
		sum += bars[rows%2];
		rows++;
	    }
	    double hSpace = unionLength / (2 * maxCols);
	    double vSpace = unionWidth / (2 * rows);
	    double y = 0;
	    GeneralPath star = getPentagram();
	    GeneralPath grid = new GeneralPath();
	    int count = 1;
	    for (int row = 0; row < rows; row++) {
		int cols = bars[row%2];
		double x = (cols == maxCols) ? 0 : hSpace;
		for (int col = 0; col < cols; col++) {
		    if (count > states) {
			break;
		    }
		    GeneralPath newStar = (GeneralPath) star.clone();
		    newStar.transform(AffineTransform.getTranslateInstance(x, y));
		    grid.append(newStar, false);
		    x += 2 * hSpace;
		    count++;
		}
		y += 2 * vSpace;
	    }
	    return grid;
	}