restructed the 2D Ising model code