private JPanel getTreasureDisplayPanel(Loot loot, int max)
	{
		JPanel panel = new JPanel();
		
		double test;
		
		//First, we determine the dimensions (always a square)
		if(max >= 0)
		{
			test = Math.sqrt(max);
		}
		else
		{
			int total = 0;
			
			for(String treasure : Treasure.allTreasures())
			{
				total+= loot.countTreasure(treasure);
			}
			
			max = total;
			test = Math.sqrt(total);
		}
		
		int side = (int) test;
		if((side^2) != max)
		{
			side++;
		}
		
		//Next, we create the panel and populate it with images
		panel.setLayout(new GridLayout(side,side));
		
		int count = 0;
		int tCount = 0;
		int index = 0;
		String[] list = Treasure.allTreasures();
		
		while(count < max && index < list.length)
		{
			if(tCount < loot.countTreasure(list[index]))
			{
				JLabel label = new JLabel();
				ImageIcon resized = new ImageIcon(((ImageIcon) getTreasureIcon(list[index]))
						.getImage().getScaledInstance(CARD_WIDTH, CARD_HEIGHT, 0));
				label.setIcon(resized);
				panel.add(label);
				count++;
				tCount++;
			}
			else
			{
				index++;
				tCount = 0;
			}
		}
		
		return panel;
		
	}