   }
   
   private func step() {
-
+    isRunning = true
+    
     renderView.population?.step(3)
     renderView.setNeedsDisplay(renderView.bounds)
     
     DispatchQueue.main.async {
+      guard self.isRunning else {
+        return
+      }
       self.step()
     }
   }

  
  // MARK: -
  private func setup() {
    let genomes: [Parameters] = [
      [25.0, 1.0, 2.0, 0.25, 0.25, 75.0, 0.35, 0.75],
      [50.0, 1.0, 2.0, 0.165, 1.0, 35.0, 0.25, 0.5],
      [15.0, 1.0, 2.0, 1.05, 0.8, 25.0, 0.333, 0.25],
      [20.0, 1.0, 2.0, 0.115, 0.8, 50.0, 0.25, 0.675],
      ]
      .map { Parameters($0)! }
    
    let genomeCount = genomes.count
    let width = Int(renderView.frame.width)
    let height = Int(renderView.frame.height)
    
    let population: [Individual] = (0..<1300)
      .map { _ in Coordinate(random() % width, random() % height) }
      .map { Individual.init(position: $0, genome: genomes[random() % genomeCount]) }
 
    let fieldSize = Coordinate(width, height)


class ViewController: NSViewController {

  @IBOutlet private weak var renderView: RenderView!
  
  private var isRunning = false
  
  override func viewDidLoad() {
    super.viewDidLoad()
