2D ising model solved with metropolis algorithm