Percolation implementation. Added libs from the course.