Finishing touches on  simulated annealing