Amendments to algorithms, implementation of SimulatedAnnealing Algorithm