fixed error in metropolis algorithm: no more infinite local energies for long runs