Adding simulated annealing code