Implemented Simulated Annealing