private void initNoiseFunctions() {
        Random rand = new Random();
        
        // Fill empty
        for (int i = 0; i < permutation.length; i++) {
            permutation[i] = -1;
        }
        
        // Generate random numbers
        for (int i = 0; i < permutation.length; i++) {
            while(true) {
                int ip = rand.nextInt(Integer.MAX_VALUE) % permutation.length;
                if (permutation[ip] == -1) {
                    permutation[ip] = i;
                    break;
                }
            }
        }
        
        // Copy
        for (int i = 0; i < permutation.length; i++) {
            p[permutation.length + i] = p[i] = permutation[i];
        }
    }