public Percolation(int N)				// create N-by-N grid, with all sites blocked
	{
		if (N<=0) 
		{
			throw new IllegalArgumentException();
		}

		this.N = N;
		uf_inst = new WeightedQuickUnionUF (N*N+2);
		uf_real = new WeightedQuickUnionUF (N*N+1);
		grid = new boolean [N*N];
		
		for (int i=0; i<N; i++)
		{
			for (int j=0; j<N; j++)
			{
				grid[N*i+j] = false;
			}
			uf_inst.union(i, N*N);
			uf_inst.union(N*(N-1)+i, N*N+1);
			uf_real.union(i, N*N);
		}
	}