public static float[] GeneratePerlinNoise(float[] baseNoise, int octaveCount)
	{
	   int width = baseNoise.length;
	 
	   float[][] smoothNoise = new float[octaveCount][]; //an array of arrays containing
	 
	   float persistance = 0.5f;
	 
	   //generate smooth noise
	   for (int i = 0; i < octaveCount; i++)
	   {
	       smoothNoise[i] = GenerateSmoothNoise(baseNoise, i);
	   }
	 
	    float[] perlinNoise = GetEmptyArray(width);
	    float amplitude = 1.0f;
	    float totalAmplitude = 0.0f;
	 
	    //blend noise together
	    for (int octave = octaveCount - 1; octave >= 0; octave--)
	    {
	       amplitude *= persistance;
	       totalAmplitude += amplitude;
	 
	       for (int i = 0; i < width; i++)
	       {
	    	   perlinNoise[i] += smoothNoise[octave][i] * amplitude;
	       }
	    }
	 
	   //normalization
	   for (int i = 0; i < width; i++)
	   {
	       perlinNoise[i] /= totalAmplitude;
	   }
	 
	   return perlinNoise;
	}