Ising model 2D javascript simulation