more porting of perlin noise