another version of genetic algorithm