Fixed SimmulatedAnnealing algorithm to swap min and max temperature if min is bigger than max