make quadratic method work more readable