Algorithm for 2D lattice is added