Checked, corrected and implemented simulated annealing