Implement Percolation class from first set of programming assignments