implemented root finding