def mandel(x0, y0):
	""" Iterate the Mandelbrot function, returns the number of
	iterations until x^2 + y^2 > 4 or 200 iterations.
	"""
	x = 0
	y = 0
	
	iteration = 0
	max_iteration = 200
	
	while ( x*x + y*y <= (2*2) and iteration < max_iteration ):
		xtemp = x*x - y*y + x0
		y = 2*x*y + y0
		x = xtemp
		iteration += 1
	
	if (iteration == max_iteration):
		iterations = max_iteration
	else:
		iterations = iteration
	
	return(iterations)