private void smoothen() {
        for (int x = 1; x < width - 1; ++x) {
            for (int z = 1; z < depth - 1; ++z) {
                float total = 0.0f;
                for (int u = -1; u <= 1; u++) {
                    for (int v = -1; v <= 1; v++) {
                        total += map[(x + u) + (z + v) * depth];
                    }
                }

                map[x + z * depth] = total / 9.0f;
            }
        }
    }