Modified simulated annealing.