adding simulated annealing