             offset = 1
         }
 
+        // BREED
+        let breedGroup = DispatchGroup()
         for i in offset..<population.size {
-            let parent1 = select(from: population)
-            let parent2 = select(from: population)
-            let child = crossover(parent1: parent1, parent2: parent2)
-            newPop[i] = child
-        }
-
+            breedQueues[i % breedQueues.count].async(group: breedGroup, execute: {
+                let parent1 = self.select(from: population)
+                let parent2 = self.select(from: population)
+                let child = self.crossover(parent1: parent1, parent2: parent2)
+                newPop[i] = child
+            })
+        }
+
+        breedGroup.notify(queue: DispatchQueue(label: "Breed Completion"), execute: {
+            breedSemaphore.signal()
+        })
+
+        breedSemaphore.wait()
+        // MUTATE
         for i in offset..<population.size {
             newPop[i] = mutate(tour: newPop[i])
         }

            }
        }


        for i in 0..<allCities.count {
            if !child.contains(city: parent2[i]) {
                for j in 0..<allCities.count {

        i += 1
    }

    backgroundQueue.async {
        let genetic = Genetic()

        var pop = Population(size: allCities.count, initialize: true)
        var tour = pop.getFittest()
        print("Start: \(tour.getDistance())")

        for i in 0..<50 {
            pop = genetic.evolve(population: pop)
            if i % 1 == 0 {
                tour = pop.getFittest()
                print("\(i + 1). \(tour.getDistance())")
            }
        }

        tour = pop.getFittest()
        print("End: \(tour.getDistance())")
        programSemaphore.signal()
    }

    programSemaphore.wait()
}


