Added newton's method for root finding.