fix mandelbrot function