Percolation class implementation class, fully tested.