Genetic algorithm implemented in c++