@Override
		public Void doInBackground() {
			if (deriv == null || eqn == null || iterations == 0) {
				return null;
			}
			int counter = 0;
			double currentX = initialStart;
			double newX = 0;

			if (eqn.computeFor(currentX) == 0) {
				root = currentX;
				return null;
			}
			while (true) {
				newX = currentX
						- (eqn.computeFor(currentX) / deriv
								.computeFor(currentX));
				synchronized (lock){
				tangentPoints.add(new Point2D.Double(currentX, eqn
						.computeFor(currentX)));
				}
				// drawTangent (g,currentX, eqn.computeFor (currentX));
				if (counter == iterations - 1 || eqn.computeFor(newX) == 0
						|| Math.abs(currentX - newX) < 0.00001
						|| eqn.computeFor(currentX) == eqn.computeFor(newX)) {
					//System.out.println("Root at " + nf.format(newX));
					root = newX;
					break;
				}
				currentX = newX;
				counter++;
			}
			return null;
		}