updated version of Percolation.java