public void addToGroup(Group g, Piece p)
	{

		if (p == null || g.pieces.contains(p) || (g.pieces.size() > 0 && g.pieces.toArray(new Piece[0])[0].team != p.team))
		{
			return;
		}
		int row = p.where.row;
		int col = p.where.col;
		g.pieces.add(p);
		if (col > 0)
		{

			addToGroup(g, squares[row][col - 1].piece);
		}
		if (row > 0)
		{
			addToGroup(g, squares[row - 1][col].piece);
		}
		if (row < 8)
		{
			addToGroup(g, squares[row + 1][col].piece);
		}
		if (col < 8)
		{
			addToGroup(g, squares[row][col + 1].piece);
		}
	}