first try of simulated annealing