Added perlin noise function.