@Override
    public HeightMap applyTo(HeightMap... heightMaps){
        double[][] finalHeights = heightMaps[0].getHeights();
        double[][] smoothedHeights = heightMaps[0].getHeights();
        int xSize = finalHeights.length;
        int ySize = finalHeights[0].length;
        for(int iteration = 0; iteration<numIterations; iteration++) {
            if (iteration % 10 == 0) System.out.println("GaussianBlurFilter " + 100 * iteration / numIterations + "% complete");

            for (int x = 0; x < xSize; x++) {
                for (int y = 0; y < finalHeights[0].length; y++) {
                    smoothedHeights[x][y] -= (averageNeighborHeight(finalHeights,x,y,xSize,ySize)-finalHeights[x][y]) * intensity;
                }
            }
            finalHeights = smoothedHeights;
        }
        return new HeightMap(finalHeights);
    }