increased max_iter to 500, exit calc earlier if done