added randFunction and mandelbrot