algorithm for searching for roots of a polynominal (will add customizable polynomial soon)