Percolation Java Code