old genetic algorithm code