Added metropolis criterion.