function res = mandelbrotIterate(c, niters)
 z = 0;
for j=1:niters
 z = z.*z + c;
if abs(z) > 2
 break;
end
end
res = j;