used simulated annealing in controller, cleaned source code