public PixImage boxBlur(int numIterations) {
    // Replace the following line with your solution.
    if (numIterations <= 0){
      return this;
    }
    PixImage current = this;
    for (int times = numIterations; numIterations > 0; numIterations -= 1){
      PixImage blur = new PixImage(getWidth(),getHeight());
      for (int x = 0; x < getWidth(); x++){
        for (int y = 0; y < getHeight(); y++){
          blur.setPixel(x,y,current.getNeighborAverage(x,y,redf),current.getNeighborAverage(x,y,greenf),current.getNeighborAverage(x,y,bluef));
        }
      }
      current = blur;
    }
    return current;
  }