Second attempt at a genetic algorithm.