Changed newton iteration to halley iteration for roots cus better convergence