Add simulated annealing code