modify the whole program to square lattice, compile passed
modify the whole program to square lattice, compile passed