private Map<String, int[]> generateRewardTable(GemEventReward rewards) {
	ArrayList<Integer> levels = new ArrayList<Integer>(rewards.getLevels());
	Collections.sort(levels);

	Map<String, int[]> table = new HashMap<String, int[]>();
	boolean hasBonusGem = false;
	Iterator<Integer> levelIter = levels.iterator();
	// scan rewards for bonus gems so the column can be eliminated if
	// there are none
	while (!hasBonusGem && levelIter.hasNext()) {
	    if (rewards.getBonusGems(levelIter.next()) > 0) {
		hasBonusGem = true;
	    }
	}
	if (hasBonusGem) {
	    String bonusGemKey = "Bonus Gem";
	    // there is at least one bonus gem, so make a table column
	    table.put(bonusGemKey, new int[levels.size()]);
	    Iterator<Integer> levelIterator = levels.iterator();
	    int i = 0;
	    while (levelIterator.hasNext()) {
		table.get(bonusGemKey)[i++] = rewards
			.getBonusGems(levelIterator.next());
	    }
	}

	for (int level : levels) {
	    Map<String, Integer> levelRewards = rewards.getRewards(level);
	    for (String item : levelRewards.keySet()) {
		// iterate over item names and for new items, add new entry
		if (!table.containsKey(item)) {
		    // item hasn't been found yet, so add an entry in the map
		    table.put(item, new int[levels.size()]);
		}
		table.get(item)[levels.indexOf(level)] = levelRewards.get(item);
	    }
	}
	return table;
    }