Polished up Genetic algorithm code.