This class has the logic for the genetic algorithm