   let visitingCallback: ((URL) -> Void)?
   let wordFoundCallback: (URL) -> Void
   let completion: (Int) -> Void
+  var currentTask: URLSessionDataTask?
 
   public init(
     startURL: URL,

  func visit(page url: Foundation.URL) {
    visitedPages.insert(url)

    let task = URLSession.shared.dataTask(with: url) { [weak self] data, _, _ in
      defer { self?.crawl() }
      guard
        let data = data,

    }

    visitingCallback?(url)
    currentTask?.resume()
  }

  func parse(document: String, url: Foundation.URL) {
