Developed the core of the simmulated annealing