Revamp simulated annealing algorithm