Fixed broken perlin noise by using an existing simplex noise module. Also fixed bug dealing with for loop boundaries not being correct.

Thanks Scott!